Prelude API
    Preparing search index...

    Interface Options<M, S, R>

    interface Options<M, S, R> {
        cap?: number;
        init?: () => S;
        name?: string;
        onDeadLetter?: (message: M, reason: unknown, self: Self<M, S>) => void;
        onError?: (
            error: unknown,
            message: M,
            self: Self<M, S>,
        ) => Directive | Promise<Directive>;
        receive: Receive<M, S, R>;
        supervisor?: Supervisor;
    }

    Type Parameters

    • M
    • S
    • R
    Index
    cap?: number

    Mailbox capacity. send/ask wait for room when the mailbox is full; 0 hands messages over directly to the handler. Defaults to Infinity.

    init?: () => S

    Creates the initial state. Called on construction and on every restart.

    name?: string

    Optional name, useful in logs and supervisors.

    onDeadLetter?: (message: M, reason: unknown, self: Self<M, S>) => void

    Called for every message that was accepted (or attempted) but will never be processed: dropped on kill/failure, or rejected because the actor was not running.

    onError?: (
        error: unknown,
        message: M,
        self: Self<M, S>,
    ) => Directive | Promise<Directive>

    Local failure policy. Defaults to 'escalate'. If the hook itself throws, the actor fails with that error.

    receive: Receive<M, S, R>

    Message handler.

    supervisor?: Supervisor

    Supervisor consulted when the local policy escalates.