Package org.zeromq
Class ZMQ.CancellationToken
- java.lang.Object
-
- org.zeromq.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 callZMQ.Socket.createCancellationToken()
.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.concurrent.atomic.AtomicBoolean
canceled
(package private) SocketBase
socket
-
Constructor Summary
Constructors Modifier Constructor Description protected
CancellationToken(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.
-
-
-
Field Detail
-
canceled
protected java.util.concurrent.atomic.AtomicBoolean canceled
-
socket
SocketBase socket
-
-
Constructor Detail
-
CancellationToken
protected CancellationToken(SocketBase socket)
-
-