Sometimes it is hard to detect why a message is not handled. It is necessary to have a flag or a method for mbox to turn on tracing of message handling.
Needs usage examples in Doxygen-comments. For message_t and user-type messages.
The current form was created when we use old VC++ without support of variadic templates. Because of that sync interaction is to be written like this:
auto f = mbox->get_one<std::string>().make_async<int>(42); auto v = mbox->get_one<std::string>().wait_forever().make_sync_get<int>(42);
But now we do not support C++ compilers without variadic templates. It means that some new form can be introduced. Something like:
auto f = so_5::make_async_get< std::string, int >(mbox, 42); auto v = so_5::make_sync_get< std::string, int >(mbox, so_5::wait_forever, 42); auto v = so_5::make_sync_get< std::string, int >(mbox, std::chrono::milliseconds(400), 42);
Postponed to next version
Very similar to prio_one_thread::quoted_round_robin. But has thread pool and distinguish between non-thread-safe and thread-safe event handlers. All non-thread-safe event handlers will work on just one working thread (all other threads in pool will wait). Thread-safe event handler can be run on several threads in parallel.
Creates a pool of working threads for every priority. Sizes of every pool could be configured.
There is a question: should this dispatcher support thread-safe event handlers or not?
Postponed to next version
Levels of run-time monitoring.
Collecting stats for count of processed events, times spend for events processing and so on.
Declined because this topic needs more thinking, discussing and samples from real-word tasks.
A new form of agents interation. An agent can send async message for a destination and SObjectizer will automatically sent back the result of message processing.
Something like that:
void my_agent::evt_one() { so_5::registered_send< request, reply >( dest, so_direct_mbox(), ... ); ... } void my_agent::evt_reply( const so_5::rt::delivery_receipt< reply > receipt ) { if( receipt.successful() ) handle_reply( receipt.result() ); else ... }
Declined because this topic needs more thinking, discussing and samples from real-word tasks.
Something like a form of automatic message result handling:
so_5::registered_send< request, reply >( dest, []( const so_5::rt::delivery_receipt< reply > receipt ) { if( receipt.succesful() ) ... }, ... /* request params */ );