Scheduler

You can schedule sending messages to actor that will be acted upon in the future. To achieve that you can use the following methods on the Actor System:

  • ScheduleOnce - will send the given message to a local actor once after a given interval

  • Schedule - will send the given message to a local actor at a given interval

  • RemoteSchedule - will send the given message to a remote actor at a given interval. This requires remoting to be enabled on the actor system.

  • RemoteScheduleOnce - will send the given message to a remote actor once after a given interval. This requires remoting to be enabled on the actor system.

  • ScheduleWithCron - will send the given message to a local actor using a cron expression.

  • RemoteScheduleWithCron - will send the given message to a remote actor using a cron expression. This requires remoting to be enabled on the actor system.

  • CancelSchedule - will cancel a prior scheduled message given its reference

  • PauseSchedule - will pause a prior scheduled message given its reference

  • ResumeSchedule - will resume a prior paused scheduled message given its reference.

Cron Expression Format

Field
Required
Allowed Values
Allowed Special Characters

Seconds

yes

0-59

, - * /

Minutes

yes

0-59

, - * /

Hours

yes

0-23

, - * /

Day of month

yes

1-31

, - * ? /

Month

yes

1-12 or JAN-DEC

, - * /

Day of week

yes

1-7 or SUN-SAT

, - * ? /

Year

no

empty, 1970-

, - * /

Note

All the schedule method comes with a ScheduleOption that can help configure:

  • The Sender to set the message's sender when the scheduled message is delivered

  • The SenderAddress to set the message's sender address. This is suitable for remote message scheduling

  • The Reference uniquely identifies the scheduled message and can be used later to manage it such as canceling, pausing or resuming.

Last updated