effect-tea-persistent
    Preparing search index...

    A rehearsal of one entity, as rehearse gives it to the scenario: what the test does to the entity, and reads of it.

    interface Rehearsal<T extends Types> {
        advance: (duration: Input) => Effect<void>;
        answer: {
            <K extends string>(
                key: K,
                ...rest: [...parameter: Parameter<T, K>[], message: T["internal"]],
            ): Effect<"Delivered" | "Dropped">;
            (
                pending: Pending,
                message: T["internal"],
            ): Effect<"Delivered" | "Dropped">;
        };
        deploy: (program: Program<T>) => Effect<void>;
        fire: {
            <K extends string>(
                key: K,
                ...parameter: Parameter<T, K>,
            ): Effect<"Delivered" | "Dropped">;
            (pending: Pending): Effect<"Delivered" | "Dropped">;
        };
        pending: <K extends string>(
            key: K,
            ...parameter: Parameter<T, K>,
        ) => Effect<PendingOf<T>>;
        projection: Effect<T["projection"]>;
        restart: Effect<void>;
        send: (
            message: T["inbound"],
            ...request: SentBy<T>,
        ) => Effect<Readonly<{ _tag: "Reused" }> | StoredReply<T["rejection"]>>;
        sendFrom: (
            message: T["inbound"],
            entity: Address,
        ) => Effect<StoredReply<T["rejection"]>>;
        state: Effect<T["state"]>;
        underWay: <K extends string>(
            key: K,
            ...parameter: Parameter<T, K>,
        ) => Effect<PendingOf<T> | null>;
    }

    Type Parameters

    Hierarchy

    • Acts<T>
      • Rehearsal
    Index
    advance: (duration: Input) => Effect<void>

    Time passes by duration. Each timer due within it fires at its time, in the order of the times, and its message is handled before the next one fires (decision 0187). At one time, a key fires again only with a due time later than the one it last fired with, or the test fails (decision 0266).

    answer: {
        <K extends string>(
            key: K,
            ...rest: [...parameter: Parameter<T, K>[], message: T["internal"]],
        ): Effect<"Delivered" | "Dropped">;
        (pending: Pending, message: T["internal"]): Effect<"Delivered" | "Dropped">;
    }

    Completes an operation with message. It is dropped when the operation's incarnation has moved on. It fails the test when the step that handles it returns the same operation under its key, which would run again at once. Given a key, it completes the work under way under the key, and fails the test when there is none (decision 0186).

    deploy: (program: Program<T>) => Effect<void>

    A deploy: the process dies, and program, a new version, activates the entity from what was stored. It keeps the work under way that it returns the same, and starts the rest as new work. It fails the test when the new program is a defect: one that changes, drops or delivers otherwise an operation under way, or bears another name. A program that cannot run as written fails it before the process dies (decision 0054).

    fire: {
        <K extends string>(
            key: K,
            ...parameter: Parameter<T, K>,
        ): Effect<"Delivered" | "Dropped">;
        (pending: Pending): Effect<"Delivered" | "Dropped">;
    }

    The time of a timer comes. Given a key, it is the timer under way under the key's (decision 0186).

    pending: <K extends string>(
        key: K,
        ...parameter: Parameter<T, K>,
    ) => Effect<PendingOf<T>>

    The work under way under key, one of the program's own (decision 0033), with its parameter for a key that takes one (decision 0132). Fails the test when there is none.

    projection: Effect<T["projection"]>

    The entity's projection, as a caller reads it after the last act of the test.

    restart: Effect<void>

    The process dies after the last commit, and the entity is activated again from what was stored. At-most-once operations under way deliver their unknown message instead of running again.

    send: (
        message: T["inbound"],
        ...request: SentBy<T>,
    ) => Effect<Readonly<{ _tag: "Reused" }> | StoredReply<T["rejection"]>>

    Delivers an inbound message from a caller. Given a request id, it is a request the test names: a second send under the same sender and request id is a retry, given the reply stored for the first and not applied again, as the runtime answers it. The reply is kept for the whole rehearsal, a restart and a deploy included, as the runtime keeps one sent with keep: 'forever'. Without a request id, each send is a new request, whose reply no named request finds (decision 0200). A second send under the same sender and request id that carries another message is answered Reused, and is not applied (decision 0269). A program whose sender is null may leave the sender out, and the request with it (decision 0245).

    sendFrom: (
        message: T["inbound"],
        entity: Address,
    ) => Effect<StoredReply<T["rejection"]>>

    Delivers an inbound message from another entity's operation, as a new run of it (decision 0059). The entity need not exist: the test answers for it. Under the address of an entity of the world, the run is none of that entity's own, so each one's message is applied, and neither is answered the other's reply (decision 0262).

    state: Effect<T["state"]>

    The entity's state, as it stands after the last act of the test.

    underWay: <K extends string>(
        key: K,
        ...parameter: Parameter<T, K>,
    ) => Effect<PendingOf<T> | null>

    The work under way under key, as pending gives it, or null when there is none (decision 0186).