Search Results for

    Show / Hide Table of Contents

    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

    Inheritance
    object
    SchedulerBase
    HashedWheelTimerScheduler
    Implements
    IScheduler
    ITellScheduler
    IAdvancedScheduler
    IActionScheduler
    IRunnableScheduler
    IDateTimeOffsetNowTimeProvider
    ITimeProvider
    IDisposable
    Inherited Members
    SchedulerBase.ScheduleOnce(TimeSpan, IRunnable, ICancelable)
    SchedulerBase.ScheduleOnce(TimeSpan, IRunnable)
    SchedulerBase.ScheduleRepeatedly(TimeSpan, TimeSpan, IRunnable, ICancelable)
    SchedulerBase.ScheduleRepeatedly(TimeSpan, TimeSpan, IRunnable)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    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 Source

    HashedWheelTimerScheduler(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 ticks-per-wheel is not between 1 and 2^30, tick-duration is less than 10 ms, or the computed wheel size would cause overflow.

    Properties

    | Edit this page View Source

    HighResMonotonicClock

    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
    SchedulerBase.HighResMonotonicClock
    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.

    | Edit this page View Source

    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
    SchedulerBase.MonotonicClock
    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.

    | Edit this page View Source

    TimeNow

    The current time in UTC.

    Declaration
    protected override DateTimeOffset TimeNow { get; }
    Property Value
    Type Description
    DateTimeOffset
    Overrides
    SchedulerBase.TimeNow

    Methods

    | Edit this page View Source

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    public void Dispose()
    | Edit this page View Source

    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
    SchedulerBase.InternalScheduleOnce(TimeSpan, IRunnable, ICancelable)
    | Edit this page View Source

    InternalScheduleOnce(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
    SchedulerBase.InternalScheduleOnce(TimeSpan, Action, ICancelable)
    | Edit this page View Source

    InternalScheduleRepeatedly(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
    SchedulerBase.InternalScheduleRepeatedly(TimeSpan, TimeSpan, IRunnable, ICancelable)
    | Edit this page View Source

    InternalScheduleRepeatedly(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
    SchedulerBase.InternalScheduleRepeatedly(TimeSpan, TimeSpan, Action, ICancelable)
    | Edit this page View Source

    InternalScheduleTellOnce(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
    SchedulerBase.InternalScheduleTellOnce(TimeSpan, ICanTell, object, IActorRef, ICancelable)
    | Edit this page View Source

    InternalScheduleTellRepeatedly(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.

    Overrides
    SchedulerBase.InternalScheduleTellRepeatedly(TimeSpan, TimeSpan, ICanTell, object, IActorRef, ICancelable)

    Implements

    IScheduler
    ITellScheduler
    IAdvancedScheduler
    IActionScheduler
    IRunnableScheduler
    IDateTimeOffsetNowTimeProvider
    ITimeProvider
    IDisposable

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    SchedulerExtensions.ScheduleOnce(IActionScheduler, int, Action, ICancelable)
    SchedulerExtensions.ScheduleOnceCancelable(IActionScheduler, int, Action)
    SchedulerExtensions.ScheduleOnceCancelable(IActionScheduler, TimeSpan, Action)
    SchedulerExtensions.ScheduleRepeatedly(IActionScheduler, int, int, Action, ICancelable)
    SchedulerExtensions.ScheduleRepeatedlyCancelable(IActionScheduler, int, int, Action)
    SchedulerExtensions.ScheduleRepeatedlyCancelable(IActionScheduler, TimeSpan, TimeSpan, Action)
    SchedulerExtensions.ScheduleTellOnceCancelable(IScheduler, int, ICanTell, object, IActorRef)
    SchedulerExtensions.ScheduleTellOnceCancelable(IScheduler, TimeSpan, ICanTell, object, IActorRef)
    SchedulerExtensions.ScheduleTellRepeatedlyCancelable(IScheduler, int, int, ICanTell, object, IActorRef)
    SchedulerExtensions.ScheduleTellRepeatedlyCancelable(IScheduler, TimeSpan, TimeSpan, ICanTell, object, IActorRef)
    SchedulerExtensions.ScheduleTellOnce(ITellScheduler, int, ICanTell, object, IActorRef, ICancelable)
    SchedulerExtensions.ScheduleTellRepeatedly(ITellScheduler, int, int, ICanTell, object, IActorRef, ICancelable)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET