A utility function for creating and delivering a revocable message.
This function can be used for sending messages and signals to mboxes and mchains, and to the direct mboxes of agents and ad-hoc agents.
Message/signal sent can be revoked by using delivery_id_t::revoke() method:
Please note that revoked message is not removed from queues where it wait for processing. But revoked message/signal will be ignored just after extraction from a queue.
Usage examples:
so_5::mbox_t mb1 = ...;
auto id1 = delivery_ns::send<my_message>(mb1, ...);
so_5::mchain_t ch1 = ...;
auto id2 = delivery_ns::send<my_message>(ch1, ...);
...
id2.revoke();
so_5::agent_t & a1 = ...;
auto id3 = delivery_ns::send<my_message>(a1, ...);
- Note
- The return value of that function must be stored somewhere. Otherwise the revocable message will be revoked automatically just right after send() returns.
- Since
- v.1.2.0
- Parameters
-
to | Target for the message. Can be a reference to mbox, mchain, agent or ad-hod agent. |
args | Message constructor parameters. |
Definition at line 427 of file pub.hpp.