schedule

fun <C : Any> SagaContext.schedule(key: String, rule: ScheduleRule, command: C, aggregateId: String? = null, block: CommandRequest.Builder<C>.() -> Unit = {})

Schedules command on the aggregate aggregateId names under key as rule says, with the fields block sets: SagaContext.schedule of command's toCommandRequest, context.schedule(DEADLINE, ScheduleRule.after(10.minutes), CancelOrder("No stock in time."), event.ref.id).


fun <C : Any> SagaContext.schedule(key: String, rule: ScheduleRule, command: C, to: AggregateRef, block: CommandRequest.Builder<C>.() -> Unit = {})

Schedules command on the aggregate the ref to names under key as rule says, with the fields block sets: SagaContext.schedule of command's toCommandRequest of a ref.