@hsl-openmaas/operation-manager
v0.1.11
Published
Client to store and send HTTP request blueprints for retrying or reversion
Downloads
10
Readme
OperationManager class
A client to store persistent operations that are executed asynchronously by the operations-microservice. Works by receiving operations from the host application and pushing them into an Azure Service Bus queue which is monitored by the operations-microservice.
An instance of the OperationManager contains an array for reverting operations and operations to revert. These arrays get appended by its makeRequest
property method, and their contents may finally be sent to the queue using the saveRevertingOps
property method.
Property method makeRequest
Executes an HTTP request, queues up its complete operation and stores any given reverting requests into property variable revertingOps
on success. Throws the request error if occurs.
Static method makeRetryableRequest
Executes an HTTP request and sends it to a provided queue as either a tryable or complete operation depending on its outcome. Swallows the request error if occurs to not interrupt parent program flow.
Property method saveRevertingOps
Takes whatever is stored in the revertingOps
and opsToRevert
property variables and queues them up