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.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionnewConnection(ResolvedAddress address, ContextMap context, TransportObserver observer) Creates and asynchronously returns a connection.newConnection(ResolvedAddress address, TransportObserver observer) Deprecated.Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsync, closeAsyncGracefullyMethods inherited from interface io.servicetalk.concurrent.api.ListenableAsyncCloseable
onClose, onClosing
-
Method Details
-
newConnection
@Deprecated default Single<C> newConnection(ResolvedAddress address, @Nullable TransportObserver observer) Deprecated.Creates and asynchronously returns a connection.- Parameters:
address- to connect.observer-TransportObserverfor the newly created connection.- Returns:
Singlethat emits the created connection.
-
newConnection
default Single<C> newConnection(ResolvedAddress address, @Nullable ContextMap context, @Nullable TransportObserver observer) Creates and asynchronously returns a connection.- Parameters:
address- to connect.context-contextof the caller (e.g. request context) ornullif no context provided.nullcontext may also mean that a connection is created outside the normal request processing (e.g. health-checking).observer-TransportObserverfor the newly created connection ornullif no observer provided.- Returns:
Singlethat emits the created connection.
-
newConnection(Object, ContextMap, TransportObserver).