CommandSchedulingService
Type parameters
▪ T: SuperConstructor
▪ T: SuperConstructor
Hierarchy
↳ Service
Service
↳ CommandSchedulingService
Implements
- Controller
- Sender
- Controller
- Publisher
- Controller
- Sender
- Controller
- Publisher
Index
Constructors
Properties
Methods
- ScheduleCommand
- UnscheduleCommand
- ensureHandleability
- getHandleableTypes
- getHandled
- getHandledCommands
- getHandledEvents
- getHandledMessages
- getHandledTypes
- getHandledTypesNames
- getHandler
- getHandlerOrThrow
- getHandlers
- getSubscribedEvents
- getTypeByHandler
- handle
- handles
- hasHandler
- initialize
- isHandleabe
- on
- overrideHandler
- publish
- registerCommandHandler
- registerEventHandler
- registerHandler
- removeHandler
- send
- setHandleableTypes
- subscribeTo
- subscribes
Constructors
constructor
+ new CommandSchedulingService(): CommandSchedulingService
Inherited from HandlingMixin.constructor
Overrides void
Returns: CommandSchedulingService
Properties
commandBus
• commandBus: CommandBus
Overrides Service.commandBus
eventBus
• eventBus: EventBus
Methods
ScheduleCommand
▸ ScheduleCommand(scheduleCommand
: ScheduleCommand): Promise‹void›
Handles scheduling delayed commands with scheduler or sends command immediately if its deliverable.
async
Parameters:
Name | Type | Description |
---|---|---|
scheduleCommand | ScheduleCommand | Instance of ScheduleCommand . |
Returns: Promise‹void›
UnscheduleCommand
▸ UnscheduleCommand(unscheduleCommand
: UnscheduleCommand): Promise‹void›
Unschedules command from scheduler.
async
Parameters:
Name | Type | Description |
---|---|---|
unscheduleCommand | UnscheduleCommand | Instance of UnscheduleCommand . |
Returns: Promise‹void›
ensureHandleability
▸ ensureHandleability(messageType
: MessageType‹Message›, handleableTypes?
: MessageType‹Message› | MessageType‹Message›[]): boolean
Implementation of Publisher
Inherited from HandlingMixin.ensureHandleability
Overrides CancelingEmployment.ensureHandleability
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
handleableTypes? | MessageType‹Message› | MessageType‹Message›[] |
Returns: boolean
getHandleableTypes
▸ getHandleableTypes(): MessageType‹Message›[]
Implementation of Publisher
Inherited from HandlingMixin.getHandleableTypes
Overrides CancelingEmployment.getHandleableTypes
Returns: MessageType‹Message›[]
getHandled
▸ getHandled(messageType
: MessageType‹Message›): MessageType‹Message›[]
Implementation of Publisher
Inherited from HandlingMixin.getHandled
Overrides CancelingEmployment.getHandled
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
Returns: MessageType‹Message›[]
getHandledCommands
▸ getHandledCommands(): MessageType‹Command›[]
Inherited from HandlingMixin.getHandledCommands
Overrides CancelingEmployment.getHandledCommands
Returns: MessageType‹Command›[]
getHandledEvents
▸ getHandledEvents(): MessageType‹Event›[]
Inherited from HandlingMixin.getHandledEvents
Overrides CancelingEmployment.getHandledEvents
Returns: MessageType‹Event›[]
getHandledMessages
▸ getHandledMessages(): MessageType‹Message›[]
Inherited from HandlingMixin.getHandledMessages
Overrides CancelingEmployment.getHandledMessages
Returns: MessageType‹Message›[]
getHandledTypes
▸ getHandledTypes(): MessageType‹Message›[]
Implementation of Publisher
Inherited from HandlingMixin.getHandledTypes
Overrides CancelingEmployment.getHandledTypes
Returns: MessageType‹Message›[]
getHandledTypesNames
▸ getHandledTypesNames(): TypeName[]
Inherited from HandlingMixin.getHandledTypesNames
Overrides CancelingEmployment.getHandledTypesNames
Returns: TypeName[]
getHandler
▸ getHandler(messageType
: MessageType‹Message›): Handler | undefined
Implementation of Publisher
Inherited from OneToOneHandlingMixin.getHandler
Overrides OneToManyHandlingMixin.getHandler
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
Returns: Handler | undefined
getHandlerOrThrow
▸ getHandlerOrThrow(messageType
: MessageType‹Message›): Handler
Implementation of Publisher
Inherited from OneToOneHandlingMixin.getHandlerOrThrow
Overrides OneToManyHandlingMixin.getHandlerOrThrow
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
Returns: Handler
getHandlers
▸ getHandlers(): Map‹MessageType‹Message›, Handler | Handler[]›
Implementation of Publisher
Inherited from HandlingMixin.getHandlers
Overrides CancelingEmployment.getHandlers
Returns: Map‹MessageType‹Message›, Handler | Handler[]›
getSubscribedEvents
▸ getSubscribedEvents(): MessageType‹Event›[]
Inherited from EventHandlingMixin.getSubscribedEvents
Overrides void
Returns: MessageType‹Event›[]
getTypeByHandler
▸ getTypeByHandler(handlerReference
: Handler): any | undefined
Inherited from OneToOneHandlingMixin.getTypeByHandler
Overrides OneToManyHandlingMixin.getTypeByHandler
Parameters:
Name | Type |
---|---|
handlerReference | Handler |
Returns: any | undefined
handle
▸ handle(message
: Message): Promise‹any›
Inherited from OneToOneHandlingMixin.handle
Overrides OneToManyHandlingMixin.handle
Parameters:
Name | Type |
---|---|
message | Message |
Returns: Promise‹any›
handles
▸ handles(): Map‹MessageType‹Command›, Handler›
Implementation of Publisher
Inherited from HandlingMixin.handles
Overrides CancelingEmployment.handles
Returns: Map‹MessageType‹Command›, Handler›
hasHandler
▸ hasHandler(messageType
: MessageType‹Message›): boolean
Implementation of Publisher
Inherited from HandlingMixin.hasHandler
Overrides CancelingEmployment.hasHandler
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
Returns: boolean
initialize
▸ initialize(): void
Implementation of Publisher
Inherited from Service.initialize
Overrides CommandHandlingMixin.initialize
Returns: void
isHandleabe
▸ isHandleabe(messageType
: MessageType‹Message›, handleableTypes?
: MessageType‹Message› | MessageType‹Message›[]): boolean
Inherited from HandlingMixin.isHandleabe
Overrides CancelingEmployment.isHandleabe
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
handleableTypes? | MessageType‹Message› | MessageType‹Message›[] |
Returns: boolean
on
▸ on(event
: Event): Promise‹void›
Inherited from EventHandlingMixin.on
Overrides void
Parameters:
Name | Type |
---|---|
event | Event |
Returns: Promise‹void›
overrideHandler
▸ overrideHandler(messageType
: MessageType‹Message›, handler
: Handler): void
Implementation of Publisher
Inherited from HandlingMixin.overrideHandler
Overrides CancelingEmployment.overrideHandler
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
handler | Handler |
Returns: void
publish
▸ publish(event
: Event): Promise‹void›
Implementation of Publisher
Inherited from EventHandlingMixin.publish
Overrides void
Parameters:
Name | Type |
---|---|
event | Event |
Returns: Promise‹void›
registerCommandHandler
▸ registerCommandHandler(commandType
: MessageType‹Command›, handler
: Handler, shouldOverride?
: boolean): void
Inherited from CommandHandlingMixin.registerCommandHandler
Overrides void
Parameters:
Name | Type |
---|---|
commandType | MessageType‹Command› |
handler | Handler |
shouldOverride? | boolean |
Returns: void
registerEventHandler
▸ registerEventHandler(eventType
: MessageType‹Event›, handler
: Handler, shouldOverride?
: boolean): void
Inherited from EventHandlingMixin.registerEventHandler
Overrides void
Parameters:
Name | Type |
---|---|
eventType | MessageType‹Event› |
handler | Handler |
shouldOverride? | boolean |
Returns: void
registerHandler
▸ registerHandler(messageType
: MessageType‹Message›, handler
: Handler, shouldOverride?
: boolean): void
Implementation of Publisher
Inherited from OneToOneHandlingMixin.registerHandler
Overrides HandlingMixin.registerHandler
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
handler | Handler |
shouldOverride? | boolean |
Returns: void
removeHandler
▸ removeHandler(messageType
: MessageType‹Message›): void
Implementation of Publisher
Inherited from HandlingMixin.removeHandler
Overrides CancelingEmployment.removeHandler
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
Returns: void
send
▸ send(command
: Command): Promise‹any›
Implementation of Sender
Inherited from CommandHandlingMixin.send
Overrides void
Parameters:
Name | Type |
---|---|
command | Command |
Returns: Promise‹any›
setHandleableTypes
▸ setHandleableTypes(handleableTypes
: MessageType‹Message› | MessageType‹Message›[]): void
Implementation of Publisher
Inherited from HandlingMixin.setHandleableTypes
Overrides CancelingEmployment.setHandleableTypes
Parameters:
Name | Type |
---|---|
handleableTypes | MessageType‹Message› | MessageType‹Message›[] |
Returns: void
subscribeTo
▸ subscribeTo(eventType
: MessageType‹Event›, handler
: Handler, shouldOverride?
: boolean): void
Inherited from EventHandlingMixin.subscribeTo
Overrides void
Parameters:
Name | Type |
---|---|
eventType | MessageType‹Event› |
handler | Handler |
shouldOverride? | boolean |
Returns: void
subscribes
▸ subscribes(): Map‹MessageType‹Event›, Handler›
Implementation of Publisher
Inherited from HandlingMixin.subscribes
Overrides CancelingEmployment.subscribes
Returns: Map‹MessageType‹Event›, Handler›