This section defines messages sent over the IPC shared memory message bus
by applications that are included in the core
These message formats are documented for the benefit of application developers and maintainers. The structures defined in some of these messages are also mirrored in some external configuration or API definitions.
In most IPC message passing, the
$context contains a single
integer which is the “Instance Index” within the sending or receiving application.
This is a simple lookup key into the application’s instance map.
i.e. For a simple one-shot request response the following is normal behavior:
A instance within the requesting app wants to send a request. It first obtains a handle for the destination application.
The sender calls
send_messagespecifing the destination application handle, and the message name.
The sender sets the
$sender_contextto be its own instance index.
$context(which is the receiver context) is always
undefat the start of the interaction.
The receiving application receives the one-shot request and creates its own internal instance to process it. It performs (usually asynchronous) processing, and at some time later will send back a response by calling
send_messageback to the original sender.
$contexton the response will be set to be the original
$sender_context. If this is the end of the transaction (i.e. if this is a simple request/response) then the
$sender_contextfor the response will be
On receiving the response, the application takes the
$contextand uses that as the instance index to look up in its hash of instances. It can find the original sender instance and resume processing for that instance.
If the transaction is more than a simple one-shot response, then the
for the response will contain the far-end’s instance index which allows both applications
to maintain context during the interaction.