Package de.esoco.coroutine.step.nio
Class AsynchronousChannelStep.ChannelCallback<V,C extends java.nio.channels.AsynchronousChannel>
- java.lang.Object
-
- de.esoco.coroutine.step.nio.AsynchronousChannelStep.ChannelCallback<V,C>
-
- All Implemented Interfaces:
java.nio.channels.CompletionHandler<V,java.nio.ByteBuffer>
- Enclosing class:
- AsynchronousChannelStep<I,O>
protected static class AsynchronousChannelStep.ChannelCallback<V,C extends java.nio.channels.AsynchronousChannel> extends java.lang.Object implements java.nio.channels.CompletionHandler<V,java.nio.ByteBuffer>ACompletionHandlerimplementation that performs an asynchronous channel operation and resumes a coroutine step afterwards (asynchronously).
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedChannelCallback(C channel, Suspension<java.nio.ByteBuffer> suspension, AsynchronousChannelStep.ChannelOperation<C> operation)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcompleted(V result, java.nio.ByteBuffer data)voidfailed(java.lang.Throwable error, java.nio.ByteBuffer data)
-
-
-
Constructor Detail
-
ChannelCallback
protected ChannelCallback(C channel, Suspension<java.nio.ByteBuffer> suspension, AsynchronousChannelStep.ChannelOperation<C> operation)
Creates a new instance.- Parameters:
channel- The channel to operate onsuspension- The suspension to be resumed when the operation is completedoperation- The asynchronous channel operation to perform
-
-
Method Detail
-
completed
public void completed(V result, java.nio.ByteBuffer data)
-
-