Since v.5.4.0 it is possible to add a new dispatcher to SObjectizer Environment after start of the Environment. New method so_5::rt::so_environment_t::add_dispatcher_if_not_exists() added for this purpose:
void my_agent::evt_long_request( const request & evt )
{
so_environment().add_dispatcher_if_not_exists(
"long_request_handler_disp",
auto coop = so_environment().create_coop(
"long_request_handler",
"long_request_handler_disp",
"child_coop" ) );
coop->set_parent_coop_name( so_coop_name() );
...
}
- Note
- There is a possibility to add new dispatcher at run-time but there is no possibility to remove it. This feature can be added in future versions of SObjectizer if there will be a necessity for it.