Companion

object Companion

Functions

Link copied to clipboard
fun <S> project(processor: String, function: String, stateType: Class<S & Any>?, blocking: Boolean = false, startFrom: StartFrom? = null, aggregates: List<String> = emptyList(), nullableState: Boolean = stateType == null, retry: HandlerRetry? = null, eventType: Class<*>? = null, handle: suspend (StateEvent<S>, SubscriptionContext) -> Unit): ProcessorBinding<S>

A @Projection's handler function of processor; of each event of the eventType when it gives one (eachEvent calls the function per event).

Link copied to clipboard
fun <S> react(processor: String, function: String, stateType: Class<S & Any>?, blocking: Boolean = false, startFrom: StartFrom? = null, aggregates: List<String> = emptyList(), nullableState: Boolean = stateType == null, retry: HandlerRetry? = null, eventType: Class<*>? = null, handle: suspend (StateEvent<S>, SubscriptionContext) -> Unit): ProcessorBinding<S>

A @Reactor's handler function of processor; of each event of the eventType when it gives one.

Link copied to clipboard
fun <S> saga(processor: String, function: String, stateType: Class<S & Any>?, blocking: Boolean = false, startFrom: StartFrom? = null, rejections: List<RejectionBinding<*>> = emptyList(), aggregates: List<String> = emptyList(), nullableState: Boolean = stateType == null, retry: HandlerRetry? = null, commits: List<CommittedBinding<*>> = emptyList(), derives: List<Class<*>> = emptyList(), schedules: List<Class<*>> = emptyList(), calls: List<Class<*>> = emptyList(), eventType: Class<*>? = null, handle: suspend (StateEvent<S>, SagaContext) -> List<CommandRequest<*>>): ProcessorBinding<S>

A @Saga's handler function of processor: it returns the requests of the commands it derives (requestsOf); the saga's @OnRejected handlers, the rejections, take the rejections of those commands, and its @OnCommitted handlers, the commits, their success receipts. It derives only the commands of the classes derives lists, schedules only those schedules lists and calls only those calls lists (@Sends).

Link copied to clipboard
fun schedule(processor: String, function: String, job: ScheduleJob, blocking: Boolean = false, rejections: List<RejectionBinding<*>> = emptyList(), retry: HandlerRetry? = null, commits: List<CommittedBinding<*>> = emptyList(), context: String? = null, derives: List<Class<*>> = emptyList(), schedules: List<Class<*>> = emptyList(), calls: List<Class<*>> = emptyList(), handle: suspend (ScheduleTick, SagaContext) -> List<CommandRequest<*>>): ProcessorBinding<JobState>

A @Saga's @OnSchedule handler function of processor, running job: a saga handler of the context's job aggregate (JobState) that hands each wow.Ticked of an instance of job to handle as a ScheduleTick, and returns the commands it derives. Its subscription reads job's instances alone, by their ids (me.ahoo.wow.kernel.schedule.ScheduleJobModel.instanceIds). context is the bounded context its job runs in, as the compiler knew it. It sends what derives, schedules and calls list, as a saga's handler does.