mbx_xact - Synchronous Send and Reply DMH Message Interaction


package require dmh
::dmh::mbx_xact boxname message {timeout 20000} {replybox {}}


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
set reply [mbx_xact DATAHUB "ping"]


Hume Integration Software,


mbx    mbx_do_xact    mbx_when_reply


mbx, DMH, IPC, interprocess communication, messaging