Handles all the two-way RPC calls between Apex and RabbitMQ. Messages sent here will not be returned until a response has been received from all listeners.
This class is available within the services container, meaning its methods can be accessed statically via the service singleton as shown below.
use apex\app; use apex\svc\msg; use apex\app\msg\objects\event_message;
// Set some message vars $vars = array( 'name' => 'John', 'email' => 'email@example.com' );
// Send a RPC call $msg = new event_message('mypackage.rkey.method', $vars); $response = msg::dispatch($msg)->get_response('mypackage');
dispatch_locally(\apex\app\interfaces\msg\EventMessageInterface $msg): \apex\app\interfaces\msg\EventResponseInterface
Dispatch a message locally
The EventMessageInterface object of the message to dispatch.
The response of the dispatched message
dispatch(\apex\app\interfaces\msg\EventMessageInterface $msg): \apex\app\interfaces\msg\EventResponseInterface
Dispatch a message via RPC to all available listeners, and wait for response.
The message to dispatch.
The Event that was passed, now modified by listeners.