Class TarantoolConnectionFactory
- java.lang.Object
-
- io.tarantool.driver.core.connection.TarantoolConnectionFactory
-
public class TarantoolConnectionFactory extends Object
Manages instantiation and connection procedures for Tarantool server connections
-
-
Constructor Summary
Constructors Constructor Description TarantoolConnectionFactory(TarantoolClientConfig config, io.netty.bootstrap.Bootstrap bootstrap, ScheduledExecutorService timeoutScheduler)
Basic constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<CompletableFuture<TarantoolConnection>>
multiConnection(InetSocketAddress serverAddress, int connections, TarantoolConnectionListeners connectionListeners)
Create several connections and return their futuresCompletableFuture<TarantoolConnection>
singleConnection(InetSocketAddress serverAddress, TarantoolConnectionListeners connectionListeners)
Create single connection and return connection future
-
-
-
Constructor Detail
-
TarantoolConnectionFactory
public TarantoolConnectionFactory(TarantoolClientConfig config, io.netty.bootstrap.Bootstrap bootstrap, ScheduledExecutorService timeoutScheduler)
Basic constructor.- Parameters:
config
- Tarantool client configbootstrap
- prepared Netty's bootstraptimeoutScheduler
- scheduled executor for limiting the connection tasks by timeout
-
-
Method Detail
-
singleConnection
public CompletableFuture<TarantoolConnection> singleConnection(InetSocketAddress serverAddress, TarantoolConnectionListeners connectionListeners)
Create single connection and return connection future- Parameters:
serverAddress
- Tarantool server address to connectconnectionListeners
- listeners for the event of establishing the connection- Returns:
- connection future
-
multiConnection
public Collection<CompletableFuture<TarantoolConnection>> multiConnection(InetSocketAddress serverAddress, int connections, TarantoolConnectionListeners connectionListeners)
Create several connections and return their futures- Parameters:
serverAddress
- Tarantool server address to connectconnections
- number of connections to createconnectionListeners
- listeners for the event of establishing the connection- Returns:
- a collection with specified number of connection futures
-
-