There are two new event methods for subscription of an event to a signal.
The first one related to event subscription for ordinary agents. It is possible to subscribe event that way:
so_subscribe_self().event< msg_get_status >( &my_agent::evt_get_status );
instead of:
so_subscribe_self().event( so_5::signal< msg_get_status >, &my_agent::evt_get_status );
The second one related to ad-hoc agents:
coop->define_agent().event< msg_get_status >(
mbox, [] {
return "ready"; } );
instead of:
coop->define_agent().event( mbox, so_5::signal< msg_get_status >, [] { return "ready"; } );
The old form with so_5::signal<MSG> marker is still supported and will be supported in the future versions of SObjectizer. Moreover the so_5::signal<MSG> marker is necessary for event unsubscription:
so_subscribe_self().event< msg_get_status >( &my_agent::evt_get_status );
so_subscribe_self().event( so_5::signal< msg_shutdown >, &my_agent::evt_shutdown );
so_drop_subscription( so_direct_mbox(), so_5::signal< msg_get_status > );
so_drop_subscription( so_direct_mbox(), so_5::signal< msg_shutdown > );