Interface ReadableFrameChannel

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean canRead()
      Returns whether this channel has a frame or error condition currently available.
      void close()
      Releases any resources associated with this readable channel.
      boolean isFinished()
      Returns whether this channel is finished.
      Frame read()
      Returns the next available frame from this channel.
      com.google.common.util.concurrent.ListenableFuture<?> readabilityFuture()
      Returns a future that will resolve when either isFinished() or canRead() would return true.
    • Method Detail

      • isFinished

        boolean isFinished()
        Returns whether this channel is finished. Finished channels will not generate any further frames or errors. Generally, once you discover that a channel is finished, you should call close() and then discard it. Note that it is possible for a channel to be unfinished and also have no available frames or errors. This happens when it is not in a ready-for-reading state. See readabilityFuture() for details.
      • canRead

        boolean canRead()
        Returns whether this channel has a frame or error condition currently available. If this method returns true, then you can call read() to retrieve the frame or error. Note that it is possible for a channel to be unfinished and also have no available frames or errors. This happens when it is not in a ready-for-reading state. See readabilityFuture() for details.
      • read

        Frame read()
        Returns the next available frame from this channel. Before calling this method, you should check canRead() to ensure there is a frame or error available.
        Throws:
        NoSuchElementException - if there is no frame currently available
      • readabilityFuture

        com.google.common.util.concurrent.ListenableFuture<?> readabilityFuture()
        Returns a future that will resolve when either isFinished() or canRead() would return true. The future will never resolve to an exception. If something exceptional has happened, the exception can be retrieved from read().
      • close

        void close()
        Releases any resources associated with this readable channel. After calling this, you should not call any other methods on the channel.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable