new QueuedEvent(queue, data)
Parameters:
Name | Type | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
queue |
module:docloop.EventQueue | The event queue this event is queued in. |
|||||||||||||||||||||||||
data |
Object |
Properties
|
Properties:
Name | Type | Description |
---|---|---|
event |
Object | Data of the original event. |
eventName |
String | Name of the original event. |
lastAttempt |
lastAttempt | Timestamp of the last attempt to process this event. |
attempts |
attempts | Number of attempts. |
Methods
-
<async> abandon(reason)
-
Emits an -fail event and removes the queued event from the queue.
Parameters:
Name Type Description reason
Error | String Error or Reason that let to the abandonment.
Returns:
undefined
-
<async> attempt()
-
Emits an -attempt event and increases the number of attempts.
Returns:
undefined
-
<async> checkOff()
-
Emits an -done event and removes the queued event from the queue.
Returns:
undefined
-
<async> remove()
-
Removes the queued event form the database.
Returns:
Result of db.collection.remove()
- Type
- Object
-
<async> store()
-
Stores the queued event to the database.
Returns:
Result of db.collection.findOneAndReplace()
- Type
- Object | Boolean
-
<async> update()
-
Updates the event in the database, increasing the number of attempts by one and setting lastAttempt to now.
Returns:
undefined