Search Results for

    Show / Hide Table of Contents

    Class SchedulerExtensions

    This class contains extension methods used for working with the different schedulers within the system.

    Inheritance
    object
    SchedulerExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Actor
    Assembly: Akka.dll
    Syntax
    public static class SchedulerExtensions

    Methods

    | Edit this page View Source

    ScheduleOnce(IActionScheduler, int, Action, ICancelable)

    Schedules an action to be invoked after an delay. The action is wrapped so that it completes inside the currently active actor if it is called from within an actor. Note! It's considered bad practice to use concurrency inside actors, and very easy to get wrong so usage is discouraged.

    Declaration
    public static void ScheduleOnce(this IActionScheduler scheduler, int millisecondsDelay, Action action, ICancelable cancelable = null)
    Parameters
    Type Name Description
    IActionScheduler scheduler

    The scheduler used to schedule the invocation of the action.

    int millisecondsDelay

    The time in milliseconds that has to pass before the action is invoked.

    Action action

    The action that is being scheduled.

    ICancelable cancelable

    OPTIONAL. A cancelable that can be used to cancel the action from being executed. Defaults to null

    | Edit this page View Source

    ScheduleOnceCancelable(IActionScheduler, int, Action)

    Schedules an action to be invoked after a delay.

    Declaration
    public static ICancelable ScheduleOnceCancelable(this IActionScheduler scheduler, int millisecondsDelay, Action action)
    Parameters
    Type Name Description
    IActionScheduler scheduler

    The scheduler used to schedule the invocation of the action.

    int millisecondsDelay

    The time in milliseconds that has to pass before the action is invoked.

    Action action

    The action that is being scheduled.

    Returns
    Type Description
    ICancelable

    A cancelable used to cancel the action from being executed.

    | Edit this page View Source

    ScheduleOnceCancelable(IActionScheduler, TimeSpan, Action)

    Schedules an action to be invoked after a delay.

    Declaration
    public static ICancelable ScheduleOnceCancelable(this IActionScheduler scheduler, TimeSpan delay, Action action)
    Parameters
    Type Name Description
    IActionScheduler scheduler

    The scheduler used to schedule the invocation of the action.

    TimeSpan delay

    The time period that has to pass before the action is invoked.

    Action action

    The action that is being scheduled.

    Returns
    Type Description
    ICancelable

    A cancelable used to cancel the action from being executed.

    | Edit this page View Source

    ScheduleRepeatedly(IActionScheduler, int, int, Action, ICancelable)

    Schedules an action to be invoked after an initial delay and then repeatedly. The action is wrapped so that it completes inside the currently active actor if it is called from within an actor. Note! It's considered bad practice to use concurrency inside actors, and very easy to get wrong so usage is discouraged.

    Declaration
    public static void ScheduleRepeatedly(this IActionScheduler scheduler, int initialMillisecondsDelay, int millisecondsInterval, Action action, ICancelable cancelable = null)
    Parameters
    Type Name Description
    IActionScheduler scheduler

    The scheduler used to schedule the invocation of the action.

    int initialMillisecondsDelay

    The time in milliseconds that has to pass before first invocation of the action.

    int millisecondsInterval

    The time in milliseconds that has to pass between each invocation of the action.

    Action action

    The action that is being scheduled.

    ICancelable cancelable

    OPTIONAL. A cancelable used to cancel the action from being executed. Defaults to null

    | Edit this page View Source

    ScheduleRepeatedlyCancelable(IActionScheduler, int, int, Action)

    Schedules an action to be invoked after an initial delay and then repeatedly.

    Declaration
    public static ICancelable ScheduleRepeatedlyCancelable(this IActionScheduler scheduler, int initialMillisecondsDelay, int millisecondsInterval, Action action)
    Parameters
    Type Name Description
    IActionScheduler scheduler

    The scheduler used to schedule the invocation of the action.

    int initialMillisecondsDelay

    The time in milliseconds that has to pass before first invocation of the action.

    int millisecondsInterval

    The time in milliseconds that has to pass between each invocation of the action.

    Action action

    The action that is being scheduled.

    Returns
    Type Description
    ICancelable

    A cancelable used to cancel the action from being executed.

    | Edit this page View Source

    ScheduleRepeatedlyCancelable(IActionScheduler, TimeSpan, TimeSpan, Action)

    Schedules an action to be invoked after an initial delay and then repeatedly.

    Declaration
    public static ICancelable ScheduleRepeatedlyCancelable(this IActionScheduler scheduler, TimeSpan initialDelay, TimeSpan interval, Action action)
    Parameters
    Type Name Description
    IActionScheduler scheduler

    The scheduler used to schedule the invocation of the action.

    TimeSpan initialDelay

    The time period that has to pass before first invocation of the action.

    TimeSpan interval

    The time period that has to pass between each invocation of the action.

    Action action

    The action that is being scheduled.

    Returns
    Type Description
    ICancelable

    A cancelable used to cancel the action from being executed.

    | Edit this page View Source

    ScheduleTellOnce(ITellScheduler, int, ICanTell, object, IActorRef, ICancelable)

    Schedules a message to be sent once after a specified period of time.

    Declaration
    public static void ScheduleTellOnce(this ITellScheduler scheduler, int millisecondsDelay, ICanTell receiver, object message, IActorRef sender, ICancelable cancelable = null)
    Parameters
    Type Name Description
    ITellScheduler scheduler

    The scheduler used to schedule the sending of the message.

    int millisecondsDelay

    The time in milliseconds that has to pass before the message is sent.

    ICanTell receiver

    The actor that receives the message.

    object message

    The message that is being sent.

    IActorRef sender

    The actor that sent the message.

    ICancelable cancelable

    OPTIONAL. An ICancelable used to cancel sending the message. Once the message has been sent, it cannot be canceled.

    | Edit this page View Source

    ScheduleTellOnceCancelable(IScheduler, int, ICanTell, object, IActorRef)

    Schedules a message to be sent once after a specified period of time.

    Declaration
    public static ICancelable ScheduleTellOnceCancelable(this IScheduler scheduler, int millisecondsDelay, ICanTell receiver, object message, IActorRef sender)
    Parameters
    Type Name Description
    IScheduler scheduler

    The scheduler used to schedule the sending of the message.

    int millisecondsDelay

    The time in milliseconds that has to pass before the message is sent.

    ICanTell receiver

    The actor that receives the message.

    object message

    The message that is being sent.

    IActorRef sender

    The actor that sent the message.

    Returns
    Type Description
    ICancelable

    An ICancelable used to cancel sending the message. Once the message already has been sent, it cannot be cancelled.

    | Edit this page View Source

    ScheduleTellOnceCancelable(IScheduler, TimeSpan, ICanTell, object, IActorRef)

    Schedules a message to be sent once after a specified period of time.

    Declaration
    public static ICancelable ScheduleTellOnceCancelable(this IScheduler scheduler, TimeSpan delay, ICanTell receiver, object message, IActorRef sender)
    Parameters
    Type Name Description
    IScheduler scheduler

    The scheduler used to schedule the sending of the message.

    TimeSpan delay

    The time period that has to pass before the message is sent.

    ICanTell receiver

    The actor that receives the message.

    object message

    The message that is being sent.

    IActorRef sender

    The actor that sent the message.

    Returns
    Type Description
    ICancelable

    An ICancelable used to cancel sending the message. Once the message already has been sent, it cannot be cancelled.

    | Edit this page View Source

    ScheduleTellRepeatedly(ITellScheduler, int, int, ICanTell, object, IActorRef, ICancelable)

    Schedules a message to be sent repeatedly after an initial delay.

    Declaration
    public static void ScheduleTellRepeatedly(this ITellScheduler scheduler, int initialMillisecondsDelay, int millisecondsInterval, ICanTell receiver, object message, IActorRef sender, ICancelable cancelable = null)
    Parameters
    Type Name Description
    ITellScheduler scheduler

    The scheduler used to schedule the sending of the message.

    int initialMillisecondsDelay

    The time in milliseconds that has to pass before the first message is sent.

    int millisecondsInterval

    The time in milliseconds that has to pass between sending of the message.

    ICanTell receiver

    The actor that receives the message.

    object message

    The message that is being sent.

    IActorRef sender

    The actor that sent the message.

    ICancelable cancelable

    OPTIONAL. An ICancelable used to cancel sending the message. Once the message has been sent, it cannot be canceled.

    | Edit this page View Source

    ScheduleTellRepeatedlyCancelable(IScheduler, int, int, ICanTell, object, IActorRef)

    Schedules a message to be sent repeatedly after an initial delay.

    Declaration
    public static ICancelable ScheduleTellRepeatedlyCancelable(this IScheduler scheduler, int initialMillisecondsDelay, int millisecondsInterval, ICanTell receiver, object message, IActorRef sender)
    Parameters
    Type Name Description
    IScheduler scheduler

    The scheduler used to schedule the sending of the message.

    int initialMillisecondsDelay

    The time in milliseconds that has to pass before the first message is sent.

    int millisecondsInterval

    The interval, i.e. the time in milliseconds that has to pass between messages are sent.

    ICanTell receiver

    The actor that receives the message.

    object message

    The message that is being sent.

    IActorRef sender

    The actor that sent the message.

    Returns
    Type Description
    ICancelable

    An ICancelable used to cancel sending the message. Once the message already has been sent, it cannot be cancelled.

    | Edit this page View Source

    ScheduleTellRepeatedlyCancelable(IScheduler, TimeSpan, TimeSpan, ICanTell, object, IActorRef)

    Schedules a message to be sent repeatedly after an initial delay.

    Declaration
    public static ICancelable ScheduleTellRepeatedlyCancelable(this IScheduler scheduler, TimeSpan initialDelay, TimeSpan interval, ICanTell receiver, object message, IActorRef sender)
    Parameters
    Type Name Description
    IScheduler scheduler

    The scheduler used to schedule the sending of the message.

    TimeSpan initialDelay

    The time period that has to pass before the first message is sent.

    TimeSpan interval

    The time period that has to pass between sending of the message.

    ICanTell receiver

    The actor that receives the message.

    object message

    The message that is being sent.

    IActorRef sender

    The actor that sent the message.

    Returns
    Type Description
    ICancelable

    An ICancelable used to cancel sending the message. Once the message already has been sent, it cannot be cancelled.

    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