Generic Function ask

Package:

CL-GSERVER.ACTOR

Syntax:

  ask ACTOR MESSAGE &KEY &KEY TIME-OUTresult

Arguments and Values:

Description:

This returns a `future'. Specify `timeout' if a message is to be expected after a certain time. An `:handler-error' with `timeout' condition will be returned is the call timed out.

An `ask' is similar to a `ask-s' in that the caller gets back a result but it doesn't have to actively wait for it. Instead a `future' wraps the result. However, the internal message handling is based on `tell'. How this works is that the message to the target `actor' is not 'sent' using the callers thread but instead an anonymous `actor' is started behind the scenes and this in fact makes tells the message to the target `actor'. It does sent itself along as 'sender'. The target `actor' tells a response back to the initial `sender'. When that happens and the anonymous `actor' received the response the `future' will be fulfilled with the `promise'.