Package de.esoco.coroutine.step.nio
Class ServerSocketAccept.AcceptCallback
- java.lang.Object
-
- de.esoco.coroutine.step.nio.ServerSocketAccept.AcceptCallback
-
- All Implemented Interfaces:
java.nio.channels.CompletionHandler<java.nio.channels.AsynchronousSocketChannel,java.lang.Void>
- Enclosing class:
- ServerSocketAccept
protected static class ServerSocketAccept.AcceptCallback extends java.lang.Object implements java.nio.channels.CompletionHandler<java.nio.channels.AsynchronousSocketChannel,java.lang.Void>ACompletionHandlerimplementation that receives the result of an asynchronous accept and processes the request with an asynchronous coroutine execution.
-
-
Constructor Summary
Constructors Constructor Description AcceptCallback(Coroutine<java.nio.channels.AsynchronousSocketChannel,?> requestHandler, Suspension<java.lang.Void> suspension)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcompleted(java.nio.channels.AsynchronousSocketChannel requestChannel, java.lang.Void ignored)voidfailed(java.lang.Throwable error, java.lang.Void ignored)
-
-
-
Constructor Detail
-
AcceptCallback
public AcceptCallback(Coroutine<java.nio.channels.AsynchronousSocketChannel,?> requestHandler, Suspension<java.lang.Void> suspension)
Creates a new instance.- Parameters:
requestHandler- The coroutine to process the request withsuspension- The suspension to resume after accepting
-
-
Method Detail
-
completed
public void completed(java.nio.channels.AsynchronousSocketChannel requestChannel, java.lang.Void ignored)- Specified by:
completedin interfacejava.nio.channels.CompletionHandler<java.nio.channels.AsynchronousSocketChannel,java.lang.Void>
-
failed
public void failed(java.lang.Throwable error, java.lang.Void ignored)- Specified by:
failedin interfacejava.nio.channels.CompletionHandler<java.nio.channels.AsynchronousSocketChannel,java.lang.Void>
-
-