Skip to content

@epikodelabs/streamix


@epikodelabs/streamix / coroutines/src/public-api / Initiator

Interface: Initiator ​

Defined in: projects/libraries/streamix/coroutines/src/lib/abstractions/actor.ts:86

Main-thread communication interface.

Initiator describes the public shape of main so that consumers can reference it explicitly rather than deriving it via typeof main.

Properties ​

outbox ​

outbox: object

Defined in: projects/libraries/streamix/coroutines/src/lib/abstractions/actor.ts:87

publish() ​

publish<T>(topic, payload, options?): void

Broadcasts a topic payload to every named actor through the actor bus.

Type Parameters ​
T ​

T = any

Parameters ​
topic ​

string

payload ​

T

options? ​

ActorBusDispatchOptions

Returns ​

void

send() ​

send<T>(to, topic, payload, options?): void

Sends a one-way bus message to one or more named actor targets.

Type Parameters ​
T ​

T = any

Parameters ​
to ​

string | string[] | Actor

topic ​

string

payload ​

T

options? ​

Pick<ActorBusDispatchOptions, "from">

Returns ​

void

request() ​

request<Q, D>(to, topic, payload): Promise<D>

Sends a request to an actor and awaits the response.

Type Parameters ​
Q ​

Q = any

D ​

D = any

Parameters ​
to ​

string | Actor

topic ​

string

payload ​

Q

Returns ​

Promise<D>

stop() ​

stop(actor): Promise<void>

Stops the actor, terminates its worker, and releases resources.

Parameters ​
actor ​

string | Actor

Returns ​

Promise<void>


inbox ​

inbox: object

Defined in: projects/libraries/streamix/coroutines/src/lib/abstractions/actor.ts:101

subscribe() ​

subscribe(handler): () => void

Subscribes to all actor-bus messages.

Parameters ​
handler ​

ActorBusHandler

Returns ​

() => void

clear() ​

clear(): void

Clears all global and direct bus listeners.

Returns ​

void

Released under the GNU AGPL v3 or later.