Actor
Defined in: src/util/actor.ts:56
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
Constructor
new Actor(
target:ActorTarget,mapId?:string|number):Actor
Defined in: src/util/actor.ts:73
Parameters
| Parameter | Type | Description |
|---|---|---|
target | ActorTarget | The target |
mapId? | string | number | A unique identifier for the Map instance using this Actor. |
Returns
Actor
Methods
sendAsync()
sendAsync<
T>(message:ActorMessage<T>,abortController?:AbortController):Promise<RequestResponseMessageMap[T][1]>
Defined in: src/util/actor.ts:97
Sends a message from a main-thread map to a Worker or from a Worker back to a main-thread map instance.
Type Parameters
| Type Parameter |
|---|
T extends MessageType |
Parameters
| Parameter | Type | Description |
|---|---|---|
message | ActorMessage<T> | the message to send |
abortController? | AbortController | an optional AbortController to abort the request |
Returns
Promise<RequestResponseMessageMap[T][1]>
a promise that will be resolved with the response data
Implementation of
IActor.sendAsync