Documentation
    Preparing search index...

    Interface ClientRaw

    Client for managing & connecting to actors.

    The actors map type that defines the available actors.

    interface ClientRaw {
        "[ACTOR_CONNS_SYMBOL]": Set<ActorConnRaw>;
        "[CREATE_ACTOR_CONN_PROXY]"<AD extends AnyActorDefinition>(
            conn: ActorConnRaw,
        ): ActorConn<AD>;
        create<AD extends AnyActorDefinition>(
            name: string,
            key?: string | string[],
            opts?: CreateOptions,
        ): Promise<ActorHandle<AD>>;
        dispose(): Promise<void>;
        get<AD extends AnyActorDefinition>(
            name: string,
            key?: string | string[],
            opts?: GetWithIdOptions,
        ): ActorHandle<AD>;
        getForId<AD extends AnyActorDefinition>(
            name: string,
            actorId: string,
            opts?: GetWithIdOptions,
        ): ActorHandle<AD>;
        getOrCreate<AD extends AnyActorDefinition>(
            name: string,
            key?: string | string[],
            opts?: GetOrCreateOptions,
        ): ActorHandle<AD>;
    }
    Index

    Properties

    "[ACTOR_CONNS_SYMBOL]": Set<ActorConnRaw> = ...

    Methods

    • Creates a new actor with the provided key and returns a stateless handle to it. Resolves the actor ID and returns a handle with getForId query.

      Type Parameters

      Parameters

      • name: string

        The name of the actor.

      • Optionalkey: string | string[]

        The key to identify the actor. Can be a single string or an array of strings.

      • Optionalopts: CreateOptions

        Options for creating the actor (excluding name and key).

      Returns Promise<ActorHandle<AD>>

      • A promise that resolves to a handle to the actor.
    • Gets a stateless handle to a actor by its key, creating it if necessary.

      Type Parameters

      Parameters

      • name: string

        The name of the actor.

      • Optionalkey: string | string[]

        The key to identify the actor. Can be a single string or an array of strings.

      • Optionalopts: GetOrCreateOptions

        Options for getting the actor.

      Returns ActorHandle<AD>

      • A handle to the actor.