CL-GSERVER.MESSAGEB
submit MESSAGE-BOX-BASE MESSAGE WITHREPLY-P TIME-OUT HANDLER-FUN → result
MESSAGE-BOX-BASE
:
a
T
MESSAGE
:
a
T
WITHREPLY-P
:
a
T
TIME-OUT
:
a
T
HANDLER-FUN
:
a
T
result
: a T.
Submit a message to the mailbox to be queued and handled.
submit <MESSAGE-BOX/BT> MESSAGE WITHREPLY-P TIME-OUT HANDLER-FUN → result
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'.
submit <MESSAGE-BOX/DP> MESSAGE WITHREPLY-P TIME-OUT HANDLER-FUN → result
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').