Represents a stream of messages and forms the base class for actors
Modifiers | Name | Description |
---|---|---|
static class |
MessageStream.RemoteMessageStream |
|
private static class |
MessageStream.ResultWaiter |
Represents a pending request for a reply from an actor. |
static class |
MessageStream.SendTo |
Modifiers | Name | Description |
---|---|---|
private static long |
serialVersionUID |
Fields inherited from class | Fields |
---|---|
class WithSerialId |
serialHandle, serialVersionUID |
Constructor and description |
---|
MessageStream
() |
Type | Name and description |
---|---|
MessageStream |
call(T message) Same as send |
java.lang.Class<RemoteMessageStream> |
getRemoteClass() |
MessageStream |
leftShift(T message) Same as send |
static void |
reInterrupt() |
MessageStream |
send(java.lang.Object message) Send message to stream and return immediately |
MessageStream |
send() Convenience method for send(new Object()). |
MessageStream |
send(T message, MessageStream replyTo) Send message to stream and return immediately. |
V |
sendAndWait(T message) Sends a message and waits for a reply. |
java.lang.Object |
sendAndWait(T message, long timeout, java.util.concurrent.TimeUnit units) Sends a message and waits for a reply. |
java.lang.Object |
sendAndWait(T message, groovy.time.Duration duration) Sends a message and waits for a reply. |
Methods inherited from class | Name |
---|---|
class WithSerialId |
createRemoteHandle, getOrCreateSerialHandle, getRemoteClass, writeReplace |
class java.lang.Object |
java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Same as send
message
- to sendSame as send
message
- to sendSend message to stream and return immediately
message
- message to sendConvenience method for send(new Object()).
Send message to stream and return immediately. Allows to specify an arbitrary actor to send replies to. By default replies are sent to the originator (sender) of each message, however, when a different actor is specified as the optional second argument to the send() method, this supplied actor will receive the replies instead.
message
- message to sendreplyTo
- where to send reply
- type of message accepted by the streamSends a message and waits for a reply. Returns the reply or throws an IllegalStateException, if the target actor cannot reply.
message
- message to sendSends a message and waits for a reply. Timeouts after the specified timeout. In case of timeout returns null. Returns the reply or throws an IllegalStateException, if the target actor cannot reply.
message
- message to sendtimeout
- timeoutunits
- unitsSends a message and waits for a reply. Timeouts after the specified timeout. In case of timeout returns null. Returns the reply or throws an IllegalStateException, if the target actor cannot reply.
message
- message to sendduration
- timeoutCopyright © 2008–2014 Václav Pech. All Rights Reserved.