public class TarantoolConnectionFactory extends Object
Modifier and Type | Field and Description |
---|---|
protected io.netty.bootstrap.Bootstrap |
bootstrap |
protected TarantoolClientConfig |
config |
protected ScheduledExecutorService |
timeoutScheduler |
Constructor and Description |
---|
TarantoolConnectionFactory(TarantoolClientConfig config,
io.netty.bootstrap.Bootstrap bootstrap,
ScheduledExecutorService timeoutScheduler)
Basic constructor.
|
Modifier and Type | Method and Description |
---|---|
Collection<CompletableFuture<TarantoolConnection>> |
multiConnection(InetSocketAddress serverAddress,
int connections,
TarantoolConnectionListeners connectionListeners)
Create several connections and return their futures
|
CompletableFuture<TarantoolConnection> |
singleConnection(InetSocketAddress serverAddress,
TarantoolConnectionListeners connectionListeners)
Create single connection and return connection future
|
protected final TarantoolClientConfig config
protected final io.netty.bootstrap.Bootstrap bootstrap
protected final ScheduledExecutorService timeoutScheduler
public TarantoolConnectionFactory(TarantoolClientConfig config, io.netty.bootstrap.Bootstrap bootstrap, ScheduledExecutorService timeoutScheduler)
config
- Tarantool client configbootstrap
- prepared Netty's bootstraptimeoutScheduler
- scheduled executor for limiting the connection tasks by timeoutpublic CompletableFuture<TarantoolConnection> singleConnection(InetSocketAddress serverAddress, TarantoolConnectionListeners connectionListeners)
serverAddress
- Tarantool server address to connectconnectionListeners
- listeners for the event of establishing the connectionpublic Collection<CompletableFuture<TarantoolConnection>> multiConnection(InetSocketAddress serverAddress, int connections, TarantoolConnectionListeners connectionListeners)
serverAddress
- Tarantool server address to connectconnections
- number of connections to createconnectionListeners
- listeners for the event of establishing the connectionCopyright © 2025 Picodata. All rights reserved.