Generic Function submit

Package:

CL-GSERVER.MESSAGEB

Syntax:

  submit MESSAGE-BOX-BASE MESSAGE WITHREPLY-P TIME-OUT HANDLER-FUNresult

Arguments and Values:

Description:

Submit a message to the mailbox to be queued and handled.

Known Documented Methods:

  1.  submit  <MESSAGE-BOX/BT> MESSAGE WITHREPLY-P TIME-OUT HANDLER-FUNresult

    Alternatively use `with-submit-handler' from your code to handle the message after it was 'popped' from the queue. The `handler-fun' argument here will be `funcall'ed when the message was 'popped'.

  2.  submit  <MESSAGE-BOX/DP> MESSAGE WITHREPLY-P TIME-OUT HANDLER-FUNresult

    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').