Class SchedulerExtensions
This class contains extension methods used for working with the different schedulers within the system.
Inherited Members
Namespace: Akka.Actor
Assembly: Akka.dll
Syntax
public static class SchedulerExtensions
Methods
| Improve this Doc View SourceScheduleOnce(IActionScheduler, Int32, 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.
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. |
Int32 | 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 |
ScheduleOnceCancelable(IActionScheduler, Int32, 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. |
Int32 | 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. |
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. |
ScheduleRepeatedly(IActionScheduler, Int32, Int32, 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.
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. |
Int32 | initialMillisecondsDelay | The time in milliseconds that has to pass before first invocation of the action. |
Int32 | 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 |
ScheduleRepeatedlyCancelable(IActionScheduler, Int32, Int32, 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. |
Int32 | initialMillisecondsDelay | The time in milliseconds that has to pass before first invocation of the action. |
Int32 | 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. |
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. |
ScheduleTellOnce(ITellScheduler, Int32, 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. |
Int32 | 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. |
ScheduleTellOnceCancelable(IScheduler, Int32, 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. |
Int32 | 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. |
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. |
ScheduleTellRepeatedly(ITellScheduler, Int32, Int32, 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. |
Int32 | initialMillisecondsDelay | The time in milliseconds that has to pass before the first message is sent. |
Int32 | 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. |
ScheduleTellRepeatedlyCancelable(IScheduler, Int32, Int32, 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. |
Int32 | initialMillisecondsDelay | The time in milliseconds that has to pass before the first message is sent. |
Int32 | 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. |
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. |