This procedure is used to send a DMH message to a mailbox, and to receive a reply message or the literal reply string, TIMEOUT. The procedure is an improved version of mbx_do_xact and is closer to the DoXact() calls provided by DMH client libraries for other programming languages.
If the optional replybox argument is not provided, the procedure manages creating a unique reply mailbox for the reply message, and closes the mailbox after use. The timeout interval for receiving a reply message may be specified in milliseconds; the default value is 20000 (20 seconds).
The logic of the command uses vwait to dispatch events while waiting for a reply. Users of the command should be aware that when modal event-dispatching calls such as this one become nested, the application logic completes and unwinds the execution stack in the order of most recent to earliest. It is bad programming practice to allow the execution stack to nest too deep --- serialization of access and asynchronous functions can be used to control nesting.
The command is part of the dmh package and it exists in the ::dmh namespace.
package require dmh dmh_import set reply [mbx_xact DATAHUB "ping"]