Open Agent Loops
API Reference

Dispatcher

@open-agent-loops/core


Defined in: channels/dispatcher.ts:98

Turns submit(sessionId, message) calls into throttled runAgent runs. See the module:channels/dispatcher | module docs for the model.

Accessors

inFlight

Get Signature

get inFlight(): number;

Defined in: channels/dispatcher.ts:109

Runs currently in flight across all sessions.

Returns

number

Constructors

Constructor

new Dispatcher(options): Dispatcher;

Defined in: channels/dispatcher.ts:103

Parameters

ParameterType
optionsDispatcherOptions

Returns

Dispatcher

Methods

stats()

stats(): DispatcherStats;

Defined in: channels/dispatcher.ts:114

Aggregate backpressure readings — what an adaptive controller acts on.

Returns

DispatcherStats


submit()

submit(sessionId, ...messages): void;

Defined in: channels/dispatcher.ts:135

Enqueue one or more messages for a session and ensure it is being pumped. Non-blocking: always returns immediately so the caller (a socket handler) can keep draining its transport. Backpressure is applied at the buffer, never here.

Parameters

ParameterTypeDescription
sessionIdstringThe session/thread the messages belong to.
...messagesMessage[]The inbound message(s).

Returns

void

On this page