Package org.zeromq

Class ZMQ.CancellationToken

  • Enclosing class:
    ZMQ

    public static class ZMQ.CancellationToken
    extends java.lang.Object
    A cancellation token that allows canceling ongoing Socket send/receive operations. When calling send/receive you can provide the cancellation token as an additional parameter. To create a cancellation token call ZMQ.Socket.createCancellationToken().
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.concurrent.atomic.AtomicBoolean canceled  
      (package private) SocketBase socket  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cancel()
      Cancel a pending the send/receive operation.
      boolean isCancellationRequested()  
      void reset()
      Reset the cancellation token in order to reuse the token with another send/receive call.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • canceled

        protected java.util.concurrent.atomic.AtomicBoolean canceled
    • Constructor Detail

      • CancellationToken

        protected CancellationToken​(SocketBase socket)
    • Method Detail

      • isCancellationRequested

        public boolean isCancellationRequested()
      • reset

        public void reset()
        Reset the cancellation token in order to reuse the token with another send/receive call.
      • cancel

        public void cancel()
        Cancel a pending the send/receive operation.