Groovy Documentation

gpars.actor.impl
Class MessageStream.ResultWaiter

java.lang.Object
  groovyx.gpars.serial.WithSerialId
      gpars.actor.impl.MessageStream
          gpars.actor.impl.MessageStream.ResultWaiter

class MessageStream.ResultWaiter
extends MessageStream

Represents a pending request for a reply from an actor.

param:
The type of expected reply message


Constructor Summary
private MessageStream.ResultWaiter()

 
Method Summary
V getResult()

Retrieves the response blocking until a message arrives

Object getResult(long timeout, TimeUnit units)

Retrieves the response blocking until a message arrives

void onDeliveryError()

Handle cases when the message sent to the actor doesn't get delivered

MessageStream send(Object message)

Accepts the message as a reply and wakes up the sleeping thread.

 
Methods inherited from class MessageStream
call, getRemoteClass, leftShift, reInterrupt, send, send, send, sendAndContinue, sendAndWait, sendAndWait, sendAndWait
 

Constructor Detail

MessageStream.ResultWaiter

private MessageStream.ResultWaiter()


 
Method Detail

getResult

public V getResult()
Retrieves the response blocking until a message arrives
return:
The received message
throws:
InterruptedException If the thread gets interrupted


getResult

public Object getResult(long timeout, TimeUnit units)
Retrieves the response blocking until a message arrives
param:
timeout How long to wait
param:
units Unit for the timeout
return:
The received message
throws:
InterruptedException If the thread gets interrupted


onDeliveryError

public void onDeliveryError()
Handle cases when the message sent to the actor doesn't get delivered


send

@Override
public MessageStream send(Object message)
Accepts the message as a reply and wakes up the sleeping thread.
param:
message message to send
return:
this


 

Groovy Documentation