handleCommandWithRetry
API reference for handleCommandWithRetry
Function: handleCommandWithRetry()
Section titled “Function: handleCommandWithRetry()”handleCommandWithRetry<
State,TEvent>(eventStore,streamId,handler,options):Promise<CommandHandlerResult<State,TEvent>>
Handle command with automatic retry on version conflicts
Type Parameters
Section titled “Type Parameters”State
TEvent
Section titled “TEvent”TEvent extends Readonly<{ data: EventData; metadata?: PlatformEventMetadata; type: string; }> = Readonly<{ data: EventData; metadata?: PlatformEventMetadata; type: string; }>
Parameters
Section titled “Parameters”eventStore
Section titled “eventStore”streamId
Section titled “streamId”string
handler
Section titled “handler”Handler<State, TEvent>
options
Section titled “options”CommandHandlerOptions<State, TEvent>
Returns
Section titled “Returns”Promise<CommandHandlerResult<State, TEvent>>