@hsl-openmaas/operation-manager

0.1.11 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @hsl-openmaas/operation-manager

Weekly Downloads

1

Version

0.1.11

License

ISC

Unpacked Size

30.2 kB

Total Files

20

Last publish

Collaborators

  • vmhonkala
  • santtusulander
  • ixevix