Package io.servicetalk.client.api
Interface ConnectionFactory<ResolvedAddress,C extends ListenableAsyncCloseable>
-
- Type Parameters:
ResolvedAddress
- The type of a resolved address that can be used for connecting.C
- The type of connections created by this factory.
- All Superinterfaces:
AsyncCloseable
,ListenableAsyncCloseable
- All Known Implementing Classes:
DelegatingConnectionFactory
public interface ConnectionFactory<ResolvedAddress,C extends ListenableAsyncCloseable> extends ListenableAsyncCloseable
A factory for creating new connections.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Single<C>
newConnection(ResolvedAddress address, TransportObserver observer)
Creates and asynchronously returns a connection.-
Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsync, closeAsyncGracefully
-
Methods inherited from interface io.servicetalk.concurrent.api.ListenableAsyncCloseable
onClose
-
-
-
-
Method Detail
-
newConnection
Single<C> newConnection(ResolvedAddress address, @Nullable TransportObserver observer)
Creates and asynchronously returns a connection.- Parameters:
address
- to connect.observer
-TransportObserver
for the newly created connection.- Returns:
Single
that emits the created connection.
-
-