Class SharedBlockingCallback.Blocker

    • Constructor Detail

      • Blocker

        protected Blocker()
    • Method Detail

      • failed

        public void failed​(Throwable cause)
        Description copied from interface: Callback

        Callback invoked when the operation fails.

        Specified by:
        failed in interface Callback
        Parameters:
        cause - the reason for the operation failure
      • block

        public void block()
                   throws IOException
        Block until the Callback has succeeded or failed and after the return leave in the state to allow reuse. This is useful for code that wants to repeatable use a FutureCallback to convert an asynchronous API to a blocking API.
        Throws:
        IOException - if exception was caught during blocking, or callback was cancelled
      • close

        public void close()
        Check the Callback has succeeded or failed and after the return leave in the state to allow reuse.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable