Package io.servicetalk.transport.api
Interface EarlyConnectionAcceptor
- All Superinterfaces:
AsyncCloseable
,ExecutionStrategyInfluencer<ConnectExecutionStrategy>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface EarlyConnectionAcceptor
extends ExecutionStrategyInfluencer<ConnectExecutionStrategy>, AsyncCloseable
Allows to accept or reject connections early in the connection setup stage.
-
Method Summary
Modifier and TypeMethodDescriptionaccept
(ConnectionInfo info) Accept or reject an incoming connection.default Completable
Used to close/shutdown a resource.default ConnectExecutionStrategy
Customize the offloading strategy for this acceptor.Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsyncGracefully
-
Method Details
-
accept
Accept or reject an incoming connection.Note that the
ConnectionInfo.sslSession()
will always return null with this acceptor since it is called before the TLS handshake is performed (and as a result no SSL session has been established).- Parameters:
info
- additional information about the connection to make an acceptance decision.- Returns:
- a completed (to accept) or a failed (to reject)
Completable
-
requiredOffloads
Customize the offloading strategy for this acceptor.- Specified by:
requiredOffloads
in interfaceExecutionStrategyInfluencer<ConnectExecutionStrategy>
- Returns:
- the
ConnectExecutionStrategy
for this acceptor.
-
closeAsync
Description copied from interface:AsyncCloseable
Used to close/shutdown a resource.- Specified by:
closeAsync
in interfaceAsyncCloseable
- Returns:
- A
Completable
that is notified once the close is complete.
-