CommitMongoDBObserver
Hierarchy
StatefulMixin
↳ CommitMongoDBObserver
Implements
- Stateful
- Stateful
Index
Constructors
Properties
Methods
- getSelectableStates
- getState
- hasState
- initializeEventHandlers
- isInOneOfStates
- isInState
- isObserving
- pauseObserving
- setState
- startObserving
- stopObserving
- validateState
Object literals
Constructors
constructor
+ new CommitMongoDBObserver(): CommitMongoDBObserver
Creates an instance of CommitMongoDBObserver. Creates an instance of CommitMongoDBObserver.
Returns: CommitMongoDBObserver
Properties
state
• state: State
Implementation of Stateful.state
Overrides StatefulMixin.state
stream
• stream: Cursor‹any› | undefined
Methods
getSelectableStates
▸ getSelectableStates(): Record‹string, State›
Implementation of Stateful
Inherited from StatefulMixin.getSelectableStates
Overrides Task.getSelectableStates
Returns: Record‹string, State›
getState
▸ getState(): State
Implementation of Stateful
Inherited from StatefulMixin.getState
Returns: State
hasState
▸ hasState(): boolean
Implementation of Stateful
Inherited from StatefulMixin.hasState
Returns: boolean
initializeEventHandlers
▸ initializeEventHandlers(): Promise‹void›
Initializes event handlers.
async
Returns: Promise‹void›
isInOneOfStates
▸ isInOneOfStates(states
: State | State[]): boolean
Implementation of Stateful
Inherited from StatefulMixin.isInOneOfStates
Overrides Task.isInOneOfStates
Parameters:
Name | Type |
---|---|
states | State | State[] |
Returns: boolean
isInState
▸ isInState(state
: State | State[]): boolean
Implementation of Stateful
Inherited from StatefulMixin.isInState
Parameters:
Name | Type |
---|---|
state | State | State[] |
Returns: boolean
isObserving
▸ isObserving(): boolean
Evaluates if Mongo's commit collection is observed.
Returns: boolean
pauseObserving
▸ pauseObserving(): Promise‹void›
Pause observing Mongo's commit collection for changes.
async
Returns: Promise‹void›
setState
▸ setState(state
: State): void
Implementation of Stateful
Inherited from StatefulMixin.setState
Parameters:
Name | Type |
---|---|
state | State |
Returns: void
startObserving
▸ startObserving(commitPublisher
: CommitPublisher): Promise‹void›
Observes MongoDB collection for changes and publishes them through CommitPublisher.
async
Parameters:
Name | Type | Description |
---|---|---|
commitPublisher | CommitPublisher | Instance implementing CommitPublisher interface. |
Returns: Promise‹void›
stopObserving
▸ stopObserving(): Promise‹void›
Stops observing observed Mongo's commit collection for changes.
async
Returns: Promise‹void›
validateState
▸ validateState(stateOrStates
: State | State[], error?
: Error): boolean
Implementation of Stateful
Inherited from StatefulMixin.validateState
Overrides Task.validateState
Parameters:
Name | Type |
---|---|
stateOrStates | State | State[] |
error? | Error |
Returns: boolean
Object literals
Static
STATES
▪ STATES: object
closed
• closed: string = "closed"
created
• created: string = "created"
ended
• ended: string = "ended"
failed
• failed: string = "failed"
finished
• finished: string = "finished"
observing
• observing: string = "observing"
paused
• paused: string = "paused"