Class HashedWheelTimerScheduler
This IScheduler implementation is built using a revolving wheel of buckets with each bucket belonging to a specific time resolution. As the "clock" of the scheduler ticks it advances to the next bucket in the circle and processes the items in it, and optionally reschedules recurring tasks into the future into the next relevant bucket.
There are akka.scheduler.ticks-per-wheel initial buckets (we round up to the nearest power of 2) with 512
being the initial default value. The timings are approximated and are still limited by the ceiling of the operating
system's clock resolution.
Further reading: http://www.cs.columbia.edu/~nahum/w6998/papers/sosp87-timing-wheels.pdf Presentation: http://www.cse.wustl.edu/~cdgill/courses/cs6874/TimingWheels.ppt
Implements
Inherited Members
Namespace: Akka.Actor
Assembly: Akka.dll
Syntax
public sealed class HashedWheelTimerScheduler : SchedulerBase, IScheduler, ITellScheduler, IAdvancedScheduler, IActionScheduler, IRunnableScheduler, IDateTimeOffsetNowTimeProvider, ITimeProvider, IDisposable
Constructors
| Edit this page View SourceHashedWheelTimerScheduler(Config, ILoggingAdapter)
Initializes a new HashedWheelTimerScheduler using values from the
akka.scheduler HOCON configuration section: ticks-per-wheel,
tick-duration, and shutdown-timeout.
Declaration
public HashedWheelTimerScheduler(Config scheduler, ILoggingAdapter log)
Parameters
| Type | Name | Description |
|---|---|---|
| Config | scheduler | The HOCON configuration section for this scheduler. |
| ILoggingAdapter | log | The logging adapter used to emit scheduler diagnostics. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown when |
Properties
| Edit this page View SourceHighResMonotonicClock
The current time since startup, as determined by the high resolution monotonic clock implementation.
Declaration
public override TimeSpan HighResMonotonicClock { get; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
Overrides
Remarks
Typically uses MonotonicClock in most implementations, but in some cases a custom implementation is used - such as when we need to do virtual time scheduling in the Akka.TestKit.
MonotonicClock
The current time since startup, as determined by the monotonic clock implementation.
Declaration
public override TimeSpan MonotonicClock { get; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
Overrides
Remarks
Typically uses MonotonicClock in most implementations, but in some cases a custom implementation is used - such as when we need to do virtual time scheduling in the Akka.TestKit.
TimeNow
The current time in UTC.
Declaration
protected override DateTimeOffset TimeNow { get; }
Property Value
| Type | Description |
|---|---|
| DateTimeOffset |
Overrides
Methods
| Edit this page View SourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
InternalScheduleOnce(TimeSpan, IRunnable, ICancelable)
Schedules an IRunnable to be executed once after a specified delay.
Declaration
protected override void InternalScheduleOnce(TimeSpan delay, IRunnable action, ICancelable cancelable)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | delay | The time to wait before executing the runnable. |
| IRunnable | action | The IRunnable to execute. |
| ICancelable | cancelable | An optional token that can be used to cancel the scheduled execution. |
Overrides
| Edit this page View SourceInternalScheduleOnce(TimeSpan, Action, ICancelable)
Schedules an Action to be invoked once after a specified delay.
Declaration
protected override void InternalScheduleOnce(TimeSpan delay, Action action, ICancelable cancelable)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | delay | The time to wait before invoking the action. |
| Action | action | The delegate to invoke. |
| ICancelable | cancelable | An optional token that can be used to cancel the scheduled invocation. |
Overrides
| Edit this page View SourceInternalScheduleRepeatedly(TimeSpan, TimeSpan, IRunnable, ICancelable)
Declaration
protected override void InternalScheduleRepeatedly(TimeSpan initialDelay, TimeSpan interval, IRunnable action, ICancelable cancelable)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | initialDelay | |
| TimeSpan | interval | |
| IRunnable | action | |
| ICancelable | cancelable |
Overrides
| Edit this page View SourceInternalScheduleRepeatedly(TimeSpan, TimeSpan, Action, ICancelable)
Schedules an Action to be invoked repeatedly, starting after an initial delay.
Declaration
protected override void InternalScheduleRepeatedly(TimeSpan initialDelay, TimeSpan interval, Action action, ICancelable cancelable)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | initialDelay | The time to wait before the first invocation. |
| TimeSpan | interval | The time between subsequent invocations. |
| Action | action | The delegate to invoke. |
| ICancelable | cancelable | An optional token that can be used to cancel the scheduled invocations. |
Overrides
| Edit this page View SourceInternalScheduleTellOnce(TimeSpan, ICanTell, object, IActorRef, ICancelable)
Schedules a single message delivery to an actor after a specified delay.
Declaration
protected override void InternalScheduleTellOnce(TimeSpan delay, ICanTell receiver, object message, IActorRef sender, ICancelable cancelable)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | delay | The time to wait before delivering the message. |
| ICanTell | receiver | The target actor or ICanTell endpoint. |
| object | message | The message to deliver. |
| IActorRef | sender | The actor to set as the sender of the message, or null. |
| ICancelable | cancelable | An optional token that can be used to cancel the scheduled delivery. |
Overrides
| Edit this page View SourceInternalScheduleTellRepeatedly(TimeSpan, TimeSpan, ICanTell, object, IActorRef, ICancelable)
Schedules repeated message deliveries to an actor, starting after an initial delay.
Declaration
protected override void InternalScheduleTellRepeatedly(TimeSpan initialDelay, TimeSpan interval, ICanTell receiver, object message, IActorRef sender, ICancelable cancelable)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | initialDelay | The time to wait before the first delivery. |
| TimeSpan | interval | The time between subsequent deliveries. |
| ICanTell | receiver | The target actor or ICanTell endpoint. |
| object | message | The message to deliver. |
| IActorRef | sender | The actor to set as the sender of the message, or null. |
| ICancelable | cancelable | An optional token that can be used to cancel the scheduled deliveries. |
Edit this page