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 TypeMethodDescriptiondefault Completableaccept(ConnectionContext ctx) Accept or reject an incoming connection.accept(ConnectionInfo info) Deprecated.default CompletableUsed to close/shutdown a resource.default ConnectExecutionStrategyCustomize the offloading strategy for this acceptor.Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsyncGracefully
-
Method Details
-
accept
Deprecated.Implementaccept(ConnectionContext)insteadAccept or reject an incoming connection.Note that the
ConnectionInfo.sslSession()will always returnnullwith this acceptor since it is called before the TLS handshake is performed (and as a result no SSL session has been established).- Parameters:
info-ConnectionInfoto make an acceptance decision- Returns:
Completable.completed()to accept, orCompletable.failed(Throwable)to reject with the cause
-
accept
Accept or reject an incoming connection.Note that the
ConnectionInfo.sslSession()will always returnnullwith this acceptor since it is called before the TLS handshake is performed (and as a result no SSL session has been established).- Parameters:
ctx-ConnectionContextwith full information about the connection to make an acceptance decision and ability to monitor when it's closed- Returns:
Completable.completed()to accept, orCompletable.failed(Throwable)to reject with the cause
-
requiredOffloads
Customize the offloading strategy for this acceptor.- Specified by:
requiredOffloadsin interfaceExecutionStrategyInfluencer<ConnectExecutionStrategy>- Returns:
- the
ConnectExecutionStrategyfor this acceptor.
-
closeAsync
Description copied from interface:AsyncCloseableUsed to close/shutdown a resource.- Specified by:
closeAsyncin interfaceAsyncCloseable- Returns:
- A
Completablethat is notified once the close is complete.
-
accept(ConnectionContext)instead