mogami-stream - v0.2.0
    Preparing search index...

    Interface ResourceContext

    Context for source setup in defer and catchError.

    interface ResourceContext {
        signal: AbortSignal;
        acquire<R>(
            acquire: (signal: AbortSignal) => R | PromiseLike<R>,
            release: (resource: R) => unknown,
        ): Promise<R>;
    }
    Index
    signal: AbortSignal

    Pass this signal to cancellable setup and reads.

    • Acquires a resource and gives this stage responsibility for releasing it.

      Call and await this method during the factory/handler invocation. acquire is skipped if the stage has stopped. Once it succeeds, release runs once after child sources and pending work finish, even if cancellation occurred during acquisition. Cancellation rejects this promise after registering release. Acquisition failures fail the stage; partial acquisition cleanup belongs to acquire. Release failures follow the normal cleanup contract. Do not also release the same resource from the returned source.

      Type Parameters

      • R

      Parameters

      • acquire: (signal: AbortSignal) => R | PromiseLike<R>
      • release: (resource: R) => unknown

      Returns Promise<R>