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.
makeRequest
Property method 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.
makeRetryableRequest
Static method 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.
saveRevertingOps
Property method Takes whatever is stored in the revertingOps
and opsToRevert
property variables and queues them up