An interface of envelope with some message/signal inside.
SObjectizer v.5.5.23 introduced a new thing: enveloped messages. It means that actual message/signal is placed into a special container called 'envelope'. This envelope is delivered to all receivers of the original message/signal. But before the calling of event handler in a receiver the original message/signal (e.g. payload) are extracted from envelope and passed to the event handler.
This interface describes 'envelope' for such containers. All envelopes should implement this interface.
Method access_hook() is called by SObjectizer when the payload of enveloped message should be accessed. For example:
- envelope is delivered to a receiver and receiver is ready to handle a message from envelope;
- envelope can't be delivered to a receiver in its current form and there is a need to transform the message/signal from the envelope to another type of message/signal. For example it can happen when limit_then_transform is used for overload control. In that case the payload should be extracted and passed to a transformation function;
- envelope should be analyzed by a delivery filter for further delivery of message.
When access_hook() is called the envelope should check the availability of the payload and, if the payload is available for processing, should pass the payload info to handler_invoker_t::invoke() method.
Please note that call of handler_invoker_t::invoke() is not guaranteed. Envelope can check some conditions (like payload expiration or revocation) and does call to invoke() only if these conditions are meet. But if some conditions are not fulfilled then access_hook() won't call handler_invoker_t::invoke() method.
- Since
- v.5.5.23