Cotal TypeScript packages
    Preparing search index...

    Interface ServiceAdapterHooks

    interface ServiceAdapterHooks {
        abandonServiceStop?: (
            context: ServiceAdapterContext & {
                process: ProcessIdentityRecord;
                requestId: string;
            },
        ) => ServiceAdapterStopAbandonment;
        buildServiceLaunch?: (
            context: ServiceAdapterContext,
        ) => ServiceAdapterLaunch | Promise<ServiceAdapterLaunch>;
        checkServiceReadiness?: (
            context: ServiceAdapterContext & {
                process: ProcessIdentityRecord;
                signal: AbortSignal;
            },
        ) => Promise<ServiceAdapterReadiness>;
        observeKernelStop?: (
            context: ServiceAdapterContext & { process: ProcessIdentityRecord },
        ) => "ports-file-removed" | "ports-file-retained";
        prepareKernelStop?: (
            context: ServiceAdapterKernelStopContext,
        ) => Promise<ServiceAdapterKernelStopPlan>;
        prepareServiceStop?: (
            context: ServiceAdapterStopContext,
        ) => Promise<ServiceAdapterStopPlan>;
        settleServiceStop?: (
            context: ServiceAdapterContext & {
                process: ProcessIdentityRecord;
                requestId: string;
            },
        ) => ServiceAdapterStopResult
        | ServiceAdapterStopRefusal
        | undefined;
        stopService?: (
            context: ServiceAdapterContext & {
                preserved?: ServiceAdapterPreservedStop;
                process: ProcessIdentityRecord;
                signal: AbortSignal;
                withAgents: boolean;
            } & { plan: ServiceAdapterStopPlan; requestId: string },
        ) => Promise<ServiceAdapterStopResult>;
    }

    Hierarchy (View Summary)

    Index
    abandonServiceStop?: (
        context: ServiceAdapterContext & {
            process: ProcessIdentityRecord;
            requestId: string;
        },
    ) => ServiceAdapterStopAbandonment

    An operator's abandon of a native stop request no receipt settles. Only once its exact process and the stopper that published it have both exited, this releases the reservation, removes the request and anything else that request armed, and returns the abandonment. Otherwise it throws a refusal and changes nothing.

    buildServiceLaunch?: (
        context: ServiceAdapterContext,
    ) => ServiceAdapterLaunch | Promise<ServiceAdapterLaunch>
    checkServiceReadiness?: (
        context: ServiceAdapterContext & {
            process: ProcessIdentityRecord;
            signal: AbortSignal;
        },
    ) => Promise<ServiceAdapterReadiness>
    observeKernelStop?: (
        context: ServiceAdapterContext & { process: ProcessIdentityRecord },
    ) => "ports-file-removed" | "ports-file-retained"

    After the exact process exit, report only the broker's own launch-bound shutdown trace.

    prepareKernelStop?: (
        context: ServiceAdapterKernelStopContext,
    ) => Promise<ServiceAdapterKernelStopPlan>

    Kernel-exit stop scope: the exact binding and every dependant guard, rechecked at effect.

    prepareServiceStop?: (
        context: ServiceAdapterStopContext,
    ) => Promise<ServiceAdapterStopPlan>
    settleServiceStop?: (
        context: ServiceAdapterContext & {
            process: ProcessIdentityRecord;
            requestId: string;
        },
    ) => ServiceAdapterStopResult
    | ServiceAdapterStopRefusal
    | undefined

    A native stop request that outlived its stopService call. Returns the same returned result once this adapter's own completed receipt for requestId and the exact process exit are both on record, or the refusal once the child's refused receipt is its only one and the request is removed. Either answer comes after releasing the reservation that request took. Undefined retains both.

    stopService?: (
        context: ServiceAdapterContext & {
            preserved?: ServiceAdapterPreservedStop;
            process: ProcessIdentityRecord;
            signal: AbortSignal;
            withAgents: boolean;
        } & { plan: ServiceAdapterStopPlan; requestId: string },
    ) => Promise<ServiceAdapterStopResult>