Skip to main content

Class: WorkflowRunOperationHandler<I, O>

A Nexus Operation implementation that is backed by a Workflow run.

Type Parameters​

I​

I

O​

O

Implements​

  • OperationHandler<I, O>

Constructors​

Constructor​

new WorkflowRunOperationHandler<I, O>(handler): WorkflowRunOperationHandler<I, O>

Parameters​

handler​

WorkflowRunOperationStartHandler<I, O>

Returns​

WorkflowRunOperationHandler<I, O>

Properties​

handler​

readonly handler: WorkflowRunOperationStartHandler<I, O>

Methods​

cancel()​

cancel(_ctx, token): Promise<void>

Handle requests to cancel an asynchronous operation.

Cancelation of a Nexus operation is:

  1. asynchronous - returning from this method only confirms that cancelation was notified; the implementation may however choose to process the cancellation at a later time, or to ignore it entirely.
  2. idempotent - implementations must ignore duplicate cancelations for the same operation.

Parameters​

_ctx​

OperationContext

token​

string

Returns​

Promise<void>

Implementation of​

nexus.OperationHandler.cancel


start()​

start(ctx, input): Promise<HandlerStartOperationResult<O>>

Handle requests to start an operation.

Return HandlerStartOperationResultSync to respond successfully inline, or HandlerStartOperationResultAsync to indicate that an asynchronous operation was started. Throw an OperationError to indicate that an operation completed as failed or canceled.

Parameters​

ctx​

StartOperationContext

input​

I

Returns​

Promise<HandlerStartOperationResult<O>>

Implementation of​

nexus.OperationHandler.start