384 template<
typename Handler>
399template<
typename Handler>
The core flow::async interface, providing an optionally multi-threaded thread pool onto which runnabl...
Concrete Concurrent_task_loop that is able to efficiently schedule Tasks within a given Op to execute...
A Concurrent_task_loop-related adapter-style class that represents a single-thread task loop; essenti...
void start(Task &&init_task_or_empty=Task())
Starts the 1 thread in the thread pool; any queued post()ed (and similar) tasks may begin executing i...
virtual util::Scheduled_task_handle schedule_at(const Fine_time_pt &at, Scheduled_task &&task)
Equivalent to schedule_from_now() except one specifies an absolute time point instead of wait duratio...
Task_loop_impl m_underlying_loop
See underlying_loop().
virtual util::Scheduled_task_handle schedule_from_now(const Fine_duration &from_now, Scheduled_task &&task)
Equivalent to post() but execution is scheduled for later, after the given time period passes.
Task_engine_ptr task_engine()
Returns a pointer to the internal util::Task_engine (a/k/a boost.asio io_service) for the purpose of ...
util::Thread_id m_started_thread_id_or_none
Before start() it is default-cted (not-a-thread); from start() on it's the started thread's ID.
Concurrent_task_loop * underlying_loop()
Returns the underlying work-horse Concurrent_task_loop.
~Single_thread_task_loop() override
Executes stop() – see its doc header please – and then cleans up any resources.
void stop()
Waits for the ongoing task/completion handler – if one is running – to return; then prevents any furt...
bool in_thread() const
Returns true if and only if the thread executing this call is the thread started by start().
virtual void post(Task &&task, Synchronicity synchronicity=Synchronicity::S_ASYNC)
Cause the given Task (function) to execute within the worker thread as soon as the thread is free of ...
Single_thread_task_loop(log::Logger *logger_ptr, util::String_view nickname)
Constructs object, making it available for post() and similar work, but without starting any thread a...
auto asio_handler_timed(Handler &&handler_moved)
Given a boost.asio completion handler handler for a boost.asio async_*() action on some boost....
Identical to Single_thread_task_loop, but all tasks posted through it are automatically timed,...
Timed_single_thread_task_loop(log::Logger *logger_ptr, util::String_view nickname, perf::Clock_type clock_type=perf::Clock_type::S_CPU_THREAD_TOTAL_HI_RES)
Constructs object, similarly to Single_thread_task_loop ctor; but with timing capabilities a-la Timed...
Timed_concurrent_task_loop_impl< perf::duration_rep_t > m_timed_loop
The task-timing decorator of our superclass Single_thread_task_loop's protected superclass.
auto asio_handler_timed(Handler &&handler_moved)
See Timed_concurrent_task_loop_impl::asio_handler_timed().
util::Scheduled_task_handle schedule_at(const Fine_time_pt &at, Scheduled_task &&task) override
Implements superclass method but with the addition of timing of task, accessible through accumulated_...
void post(Task &&task, Synchronicity synchronicity=Synchronicity::S_ASYNC) override
Implements superclass method but with the addition of timing of task, accessible through accumulated_...
perf::Duration accumulated_time()
See Timed_concurrent_task_loop_impl::accumulated_time().
util::Scheduled_task_handle schedule_from_now(const Fine_duration &from_now, Scheduled_task &&task) override
Implements superclass method but with the addition of timing of task, accessible through accumulated_...
Convenience class that simply stores a Logger and/or Component passed into a constructor; and returns...
Interface that the user should implement, passing the implementing Logger into logging classes (Flow'...
An empty interface, consisting of nothing but a default virtual destructor, intended as a boiler-plat...
Flow module containing tools enabling multi-threaded event loops operating under the asynchronous-tas...
Synchronicity
Enumeration indicating the manner in which asio_exec_ctx_post(), and various boost....
@ S_ASYNC
Simply post the given task to execute asynchronously in some execution context – as soon as the conte...
boost::shared_ptr< util::Task_engine > Task_engine_ptr
Short-hand for reference-counting pointer to a mutable util::Task_engine (a/k/a boost::asio::io_servi...
Function< void()> Task
Short-hand for a task that can be posted for execution by a Concurrent_task_loop or flow::util::Task_...
Fine_duration Duration
Short-hand for a high-precision boost.chrono duration, formally equivalent to flow::Fine_duration.
Clock_type
Clock types supported by flow::perf module facilities, perf::Checkpointing_timer in particular.
@ S_CPU_THREAD_TOTAL_HI_RES
Similar to S_CPU_TOTAL_HI_RES but applied to the calling thread as opposed to entire process.
Thread::id Thread_id
Short-hand for an OS-provided ID of a util::Thread.
boost::shared_ptr< Scheduled_task_handle_state > Scheduled_task_handle
Black-box type that represents a handle to a scheduled task as scheduled by schedule_task_at() or sch...
Basic_string_view< char > String_view
Commonly used char-based Basic_string_view. See its doc header.
Fine_clock::duration Fine_duration
A high-res time duration as computed from two Fine_time_pts.
Fine_clock::time_point Fine_time_pt
A high-res time point as returned by Fine_clock::now() and suitable for precise time math in general.