OnStateEvent

@OnMessage(functionKind = FunctionKind.STATE_EVENT, defaultFunctionName = "onStateEvent")
annotation class OnStateEvent(val value: String)

Marks a function as a handler for state events, indicating that the function should be invoked when a state event is emitted. This annotation is used in conjunction with the OnMessage annotation to specify the type of message and default function name.

The value parameter allows specifying one or more aggregate names to which this state event handler applies.

Examples:

    @OnStateEvent
fun onStateEvent(changed: Changed, state: State) {
//...
}

Remote Context:

    @OnStateEvent
fun onStateEvent(changed: Changed, stateRecord: StateRecord) {
val state = stateRecord.toState<StateData>()
//...
}

Author

ahoo wang

Properties

Link copied to clipboard
val value: Array<out String>

aggregate Names