Documentation
    Preparing search index...

    Interface ActorAccessor<AD>

    Represents a actor accessor that provides methods to interact with a specific actor.

    interface ActorAccessor<AD extends AnyActorDefinition> {
        create(
            key?: string | string[],
            opts?: CreateOptions,
        ): Promise<ActorHandle<AD>>;
        get(key?: string | string[], opts?: GetWithIdOptions): ActorHandle<AD>;
        getForId(actorId: string, opts?: GetWithIdOptions): ActorHandle<AD>;
        getOrCreate(
            key?: string | string[],
            opts?: GetOrCreateOptions,
        ): ActorHandle<AD>;
    }

    Type Parameters

    Index

    Methods

    • Creates a new actor with the name automatically injected from the property accessor, and returns a stateless handle to it with the actor ID resolved.

      Parameters

      • 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. The actor name is automatically injected from the property accessor.

      Parameters

      • 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.