schedule

abstract fun schedule(key: String, rule: ScheduleRule, request: CommandRequest<*>)

Schedules request's command on its target under key as rule says: the execution derives the system command wow.schedule.SetSchedule to that target with the commands the handler returns, after them, keyed as a returned request is, so handling the commit again derives the same request. The handler declares the class of the command in its @Sends(schedules). The target must exist: otherwise it rejects the command, which the saga's @OnRejected handler for SetSchedule gets. key names the schedule among the target's: setting it again replaces it, and cancelSchedule cancels it. An after rule counts from the commit that sets it on the target.

A cron rule whose expression or time zone cannot be read, or that names no time that ever comes, is the handler's mistake: its handling fails for good and parks. A rule from input is checked by the domain before it is scheduled.

The shorthand takes the command itself, its id and a block of the request's other fields (context.schedule(key, rule, CancelOrder(reason), orderId), import me.ahoo.wow.api.subscribe.schedule).