A function for creation an instance of asio_one_thread dispatcher.
Usage examples:
asio_disp::disp_params_t params;
params.use_own_io_context();
env,
"my_asio_disp",
std::move(disp_params) );
asio::io_context & io_svc = ...;
asio_disp::disp_params_t params;
params.use_external_io_context( io_svc );
env,
"my_asio_disp",
std::move(disp_params) );
- Requirements for traits type
- The Traits-type is empty in v.1.5.0. There was a possibitily to specify a custom thread type in previous versions of so_5_extra, but since v.1.5.0 custom threads are supported via standard SObjectizer's mechanism based on
abstract_work_thread_t
/abstract_work_thread_factory_t
interfaces. But the Traits-type might be extended by some content in future versions.
- Template Parameters
-
Traits | Type with traits for a dispatcher. For the requirements for Traits type see the section "Requirements for traits type" above. |
- Since
- v.1.4.1
- Parameters
-
env | SObjectizer environment to work in. |
data_sources_name_base | Short name for this instance to be used in thread activity stats. Can be empty string. In this case name will be generated automatically. |
params | Parameters for this dispatcher instance. |
- Examples:
- async_op/time_limited/simple/main.cpp, async_op/time_unlimited/simple/main.cpp, disp/asio_one_thread/custom_pthread/main.cpp, disp/asio_one_thread/ping_pong/main.cpp, disp/asio_one_thread/resolve_n/main.cpp, disp/asio_thread_pool/custom_pthread_thread/main.cpp, disp/asio_thread_pool/hello_world/main.cpp, mboxes/collecting_mbox/advanced/main.cpp, mboxes/collecting_mbox/simple/main.cpp, mboxes/composite/simple/main.cpp, mboxes/inflight_limit/simple/main.cpp, mboxes/round_robin/advanced/main.cpp, and sync/simple/main.cpp.
Definition at line 893 of file pub.hpp.