Class Actor

An implementation of the Actor design pattern that maintains the relationship between asynchronous tasks and the objects that spin them off - in this case, tasks like parsing parts of styles, owned by the styles

Implements

Constructors

Methods

Constructors

  • Parameters

    • target: ActorTarget

      The target

    • Optional mapId: string | number

      A unique identifier for the Map instance using this Actor.

    Returns Actor

Methods

  • Sends a message from a main-thread map to a Worker or from a Worker back to a main-thread map instance.

    Type Parameters

    Parameters

    • message: ActorMessage<T>

      the message to send

    • Optional abortController: AbortController

      an optional AbortController to abort the request

    Returns Promise<RequestResponseMessageMap[T][1]>

    a promise that will be resolved with the response data