public interface ZAgent
An agent is a mechanism allowing to send messages from one thread to another, and to receive messages from this other thread.
Its built-in implementation provides an easy communication-lock system that will close the access once the remote thread is finished.
Are proposed for you a restrained set of simple but powerful messaging commands for a quick learning curve and an access to the underlying Socket for advanced usage.
Modifier and Type | Interface and Description |
---|---|
static class |
ZAgent.Creator |
static interface |
ZAgent.SelectorCreator
Deprecated.
|
static class |
ZAgent.SimpleAgent
Creates a very simple agent with an easy lock mechanism.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the pipe.
|
ZMQ.Socket |
pipe()
Returns the socket used for communication.
|
ZMsg |
recv()
Receives a control message sent from the Plateau in the Corbeille.
|
ZMsg |
recv(boolean wait)
Receives a control message sent from the Plateau in the Corbeille.
|
ZMsg |
recv(int timeout)
Receives a control message sent from the Plateau in the Corbeille.
|
boolean |
send(java.lang.String word)
Sends a control message from the Corbeille to the Plateau side.
|
boolean |
send(java.lang.String word,
boolean more)
Sends a control message from the Corbeille to the Plateau side.
|
boolean |
send(ZMsg message)
Sends a control message from the Corbeille to the Plateau.
|
boolean |
send(ZMsg msg,
boolean destroy)
Sends a control message from Corbeille side to the Plateau side.
|
boolean |
sign()
Gives a sign if the distant Star is here.
|
ZMsg recv()
ZMsg recv(int timeout)
timeout
- the timeout in milliseconds before returning null.ZMsg recv(boolean wait)
wait
- true to make a blocking call, false to not wait, and possibly return nullboolean send(ZMsg message)
message
- the message to sendboolean send(ZMsg msg, boolean destroy)
msg
- the message to senddestroy
- true to destroy the message after sending it.boolean send(java.lang.String word)
word
- the message to sendboolean send(java.lang.String word, boolean more)
word
- the message to sendmore
- true to send more strings in a single messageboolean sign()
ZMQ.Socket pipe()
void close()