A monotonic clock for scheduling timeouts and delayed messages.
More...
#include <actor_clock.hpp>
Inherited by caf::detail::test_actor_clock, and caf::detail::thread_safe_actor_clock.
|
| enum class | stall_policy {
fail
,
skip
} |
| | Configures how the clock responds to a stalling actor when trying to schedule a periodic action. More...
|
| |
|
using | clock_type = std::chrono::steady_clock |
| | Underlying clock type.
|
| |
|
using | time_point = typename clock_type::time_point |
| | Discrete point in time.
|
| |
|
using | duration_type = typename clock_type::duration |
| | Time interval.
|
| |
|
|
virtual time_point | now () const noexcept |
| | Returns the current wall-clock time.
|
| |
| disposable | schedule (action f) |
| | Schedules an action for execution.
|
| |
| disposable | schedule (time_point t, action f) |
| | Schedules an action for execution at a later time.
|
| |
| virtual disposable | schedule_periodically (time_point first_run, action f, duration_type period)=0 |
| | Schedules an action for periodic execution.
|
| |
| disposable | schedule (time_point t, action f, strong_actor_ptr target) |
| | Schedules an action for execution by an actor at a later time.
|
| |
| disposable | schedule_periodically (time_point first_run, action f, strong_actor_ptr target, duration_type period, stall_policy policy) |
| | Schedules an action for periodic execution by an actor.
|
| |
| disposable | schedule (time_point t, action f, weak_actor_ptr target) |
| | Schedules an action for execution by an actor at a later time.
|
| |
| disposable | schedule_periodically (time_point first_run, action f, weak_actor_ptr target, duration_type period, stall_policy policy) |
| | Schedules an action for periodic execution by an actor.
|
| |
|
disposable | schedule_message (time_point t, strong_actor_ptr receiver, mailbox_element_ptr content) |
| | Schedules an arbitrary message to receiver for time point t.
|
| |
|
disposable | schedule_message (time_point t, weak_actor_ptr receiver, mailbox_element_ptr content) |
| | Schedules an arbitrary message to receiver for time point t.
|
| |
|
disposable | schedule_message (time_point t, group target, strong_actor_ptr sender, message content) |
| | Schedules an arbitrary message to target for time point t.
|
| |
A monotonic clock for scheduling timeouts and delayed messages.
◆ stall_policy
Configures how the clock responds to a stalling actor when trying to schedule a periodic action.
| Enumerator |
|---|
| skip | Causes the clock to dispose an action send an error to the actor.
|
◆ schedule() [1/4]
Schedules an action for execution.
- Parameters
-
- Note
- The action runs on the thread of the clock worker and thus must complete within a very short time in order to not delay other work.
◆ schedule() [2/4]
Schedules an action for execution at a later time.
- Parameters
-
| t | The local time at which the action should run. |
| f | The action to schedule. |
- Note
- The action runs on the thread of the clock worker and thus must complete within a very short time in order to not delay other work.
◆ schedule() [3/4]
Schedules an action for execution by an actor at a later time.
- Parameters
-
| t | The local time at which the action should get enqueued to the mailbox of the target. |
| f | The action to schedule. |
| target | The actor that should run the action. |
◆ schedule() [4/4]
Schedules an action for execution by an actor at a later time.
- Parameters
-
| target | The actor that should run the action. |
| f | The action to schedule. |
| t | The local time at which the action should get enqueued to the mailbox of the target. |
◆ schedule_periodically() [1/3]
Schedules an action for periodic execution.
- Parameters
-
| first_run | The local time at which the action should run initially. |
| f | The action to schedule. |
| period | The time to wait between two runs. A non-positive period disables periodic execution. |
- Note
- The action runs on the thread of the clock worker and thus must complete within a very short time in order to not delay other work.
◆ schedule_periodically() [2/3]
Schedules an action for periodic execution by an actor.
- Parameters
-
| first_run | The local time at which the action should get enqueued to the mailbox of the target for the first time. |
| f | The action to schedule. |
| target | The actor that should run the action. |
| period | The time to wait between two messages to the actor. |
| policy | The strategy for dealing with a stalling target. |
◆ schedule_periodically() [3/3]
Schedules an action for periodic execution by an actor.
- Parameters
-
| first_run | The local time at which the action should get enqueued to the mailbox of the target for the first time. |
| f | The action to schedule. |
| target | The actor that should run the action. |
| period | The time to wait between two messages to the actor. |
| policy | The strategy for dealing with a stalling target. |
The documentation for this class was generated from the following file:
- libcaf_core/caf/actor_clock.hpp