Skip to content

@epikodelabs/streamix


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

Interface: ActorBus ​

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

Main-thread actor bus integrated into the actor messaging surface.

Workers send direct messages through utils.outbox.send(to, topic, payload), while the main thread can publish or send through main.bus.

Properties ​

publish ​

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

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

Broadcasts a topic payload to every actor.

Type Parameters ​

T ​

T = any

Parameters ​

topic ​

string

payload ​

T

options? ​

ActorBusDispatchOptions

Returns ​

void


send ​

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

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

Sends a topic payload to one or more explicit actor names.

Type Parameters ​

T ​

T = any

Parameters ​

to ​

ActorBusTarget

topic ​

string

payload ​

T

options? ​

Pick<ActorBusDispatchOptions, "from">

Returns ​

void


dispatch ​

dispatch: <T>(message, options?) => void

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

Routes a prebuilt actor-bus envelope.

Type Parameters ​

T ​

T = any

Parameters ​

message ​

ActorBusMessage<T>

options? ​

Pick<ActorBusDispatchOptions, "includeSelf">

Returns ​

void


listen ​

listen: {<T>(handler): () => void; <T>(name, handler): () => void; }

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

Listens to all routed bus envelopes, or only to direct messages sent to a name.

Call Signature ​

<T>(handler): () => void

Type Parameters ​
T ​

T = any

Parameters ​
handler ​

ActorBusHandler<T>

Returns ​

() => void

Call Signature ​

<T>(name, handler): () => void

Type Parameters ​
T ​

T = any

Parameters ​
name ​

string

handler ​

ActorBusHandler<T>

Returns ​

() => void


clear ​

clear: () => void

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

Clears all actor registrations and listeners from the integrated bus.

Returns ​

void

Released under the GNU AGPL v3 or later.