Class AsynchronousChannelStep.ChannelCallback<V,​C extends java.nio.channels.AsynchronousChannel>

  • 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>
    A CompletionHandler implementation that performs an asynchronous channel operation and resumes a coroutine step afterwards (asynchronously).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void completed​(V result, java.nio.ByteBuffer data)  
      void failed​(java.lang.Throwable error, java.nio.ByteBuffer data)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 on
        suspension - The suspension to be resumed when the operation is completed
        operation - The asynchronous channel operation to perform
    • Method Detail

      • completed

        public void completed​(V result,
                              java.nio.ByteBuffer data)
        Specified by:
        completed in interface java.nio.channels.CompletionHandler<V,​C extends java.nio.channels.AsynchronousChannel>
      • failed

        public void failed​(java.lang.Throwable error,
                           java.nio.ByteBuffer data)
        Specified by:
        failed in interface java.nio.channels.CompletionHandler<V,​C extends java.nio.channels.AsynchronousChannel>