Method submit

Package:

CL-GSERVER.MESSAGEB

Syntax:

  submit SELF MESSAGE WITHREPLY-P TIME-OUT HANDLER-FUNresult

Arguments and Values:

Description:

Submitting a message on a multi-threaded `dispatcher' is different as submitting on a single threaded message-box. On a single threaded message-box the order of message processing is guaranteed even when submitting from multiple threads. On the `dispatcher' this is not the case. The order cannot be guaranteed when messages are processed by different `dispatcher' threads. However, we still guarantee a 'single-threadedness' regarding the state of the actor. This is archieved here by protecting the `handler-fun' executation by a lock.

The `time-out' with the 'dispatcher mailbox' assumes that the message received the dispatcher queue and the handler in a reasonable amount of time, so that the effective time-out applies on the actual handling of the message on the dispatcher queue thread.

!!! attention: the `ask' uses no reply (here a `dispatch-async').