nexus-rpc
    Preparing search index...

    Interface OperationHandler<I, O>Experimental

    A handler for a Nexus operation.

    This interface is meant to be implemented by Nexus service implementors.

    interface OperationHandler<I, O> {
        cancel(ctx: OperationContext, token: string): Promise<void>;
        start(
            ctx: StartOperationContext,
            input: I,
        ): Promise<HandlerStartOperationResult<O>>;
    }

    Type Parameters

    • I
    • O
    Index

    Methods

    Methods

    • Experimental

      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

      Returns Promise<void>