Asynchronous Operations

Ownera Transactional API exposes some endpoints which their invocation trigger an operation that may span multiple nodes on the FinP2P network, those operations may be long running, their execution time may fluctuate between milliseconds to minutes and are out of the control of your organization FinP2P node.

To accommodate for those cases, the Transactional API provides an Operation semantics which allows the API's client to safely invoke the endpoints and recover from possible failures that may occur while executing a long running operation.

Endpoints which represent a potential long running operation will provide as their response metadata information about the operation execution, this information includes the operation completion status (isCompleted) and correlation id (cid) that serves as a unique identifier for the underlying operation execution.

Those two fields indicate to the client executing the endpoint what is the status of the operation and how he should handle the processing of the endpoint results:

  • isCompleted == true : the operation is completed and a response or error (but not both) should be available in the response
  • isCompleted == false : the cid field should contain a unique value to identify the long running operation, the client should use that id when querying for the status of operation.

When an operation is not completed (isCompleted == false) the client is expected to poll on the Get Operation Status endpoint, using the cid provided, until the operation is in a completed status (isCompleted == true) and the response or error fields are present to represent the operation outcome.