Package org.apache.pekko.http.javadsl
Class IncomingConnection
java.lang.Object
org.apache.pekko.http.javadsl.IncomingConnection
Represents one accepted incoming HTTP connection.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.pekko.stream.javadsl.Flow<HttpResponse,HttpRequest, org.apache.pekko.NotUsed> flow()A flow representing the incoming requests and outgoing responses for this connection.<Mat> MathandleWith(org.apache.pekko.stream.javadsl.Flow<HttpRequest, HttpResponse, Mat> handler, org.apache.pekko.stream.Materializer materializer) Handles the connection with the given flow, which is materialized exactly once and the respective materialization result returned.voidhandleWithAsyncHandler(org.apache.pekko.japi.function.Function<HttpRequest, CompletionStage<HttpResponse>> handler, int parallelism, org.apache.pekko.stream.Materializer materializer) Handles the connection with the given handler function.voidhandleWithAsyncHandler(org.apache.pekko.japi.function.Function<HttpRequest, CompletionStage<HttpResponse>> handler, org.apache.pekko.stream.Materializer materializer) Handles the connection with the given handler function.voidhandleWithSyncHandler(org.apache.pekko.japi.function.Function<HttpRequest, HttpResponse> handler, org.apache.pekko.stream.Materializer materializer) Handles the connection with the given handler function.The local address of this connection.The address of the remote peer.
-
Constructor Details
-
IncomingConnection
-
-
Method Details
-
flow
public org.apache.pekko.stream.javadsl.Flow<HttpResponse,HttpRequest, flow()org.apache.pekko.NotUsed> A flow representing the incoming requests and outgoing responses for this connection.Use
Flow.joinor one of the handleXXX methods to consume handle requests on this connection.- Returns:
- (undocumented)
-
handleWith
public <Mat> Mat handleWith(org.apache.pekko.stream.javadsl.Flow<HttpRequest, HttpResponse, Mat> handler, org.apache.pekko.stream.Materializer materializer) Handles the connection with the given flow, which is materialized exactly once and the respective materialization result returned.- Parameters:
handler- (undocumented)materializer- (undocumented)- Returns:
- (undocumented)
-
handleWithAsyncHandler
public void handleWithAsyncHandler(org.apache.pekko.japi.function.Function<HttpRequest, CompletionStage<HttpResponse>> handler, org.apache.pekko.stream.Materializer materializer) Handles the connection with the given handler function.- Parameters:
handler- (undocumented)materializer- (undocumented)
-
handleWithAsyncHandler
public void handleWithAsyncHandler(org.apache.pekko.japi.function.Function<HttpRequest, CompletionStage<HttpResponse>> handler, int parallelism, org.apache.pekko.stream.Materializer materializer) Handles the connection with the given handler function.- Parameters:
handler- (undocumented)parallelism- (undocumented)materializer- (undocumented)
-
handleWithSyncHandler
public void handleWithSyncHandler(org.apache.pekko.japi.function.Function<HttpRequest, HttpResponse> handler, org.apache.pekko.stream.Materializer materializer) Handles the connection with the given handler function.- Parameters:
handler- (undocumented)materializer- (undocumented)
-
localAddress
The local address of this connection.- Returns:
- (undocumented)
-
remoteAddress
The address of the remote peer.- Returns:
- (undocumented)
-