Open Agent Loops
API Reference

AsyncWriter

@open-agent-loops/core


Defined in: observability/async-writer.ts:26

Accessors

pending

Get Signature

get pending(): number;

Defined in: observability/async-writer.ts:46

Lines waiting to be written.

Returns

number

Constructors

Constructor

new AsyncWriter(write, options?): AsyncWriter;

Defined in: observability/async-writer.ts:37

Parameters

ParameterType
write(lines) => void | Promise<void>
optionsAsyncWriterOptions

Returns

AsyncWriter

Methods

enqueue()

enqueue(line): void | Promise<void>;

Defined in: observability/async-writer.ts:55

Queue a line. Returns nothing on the fast path; returns a promise (resolving when the queue drains) only when the queue is at/over maxQueue, so an awaiting producer is throttled.

Parameters

ParameterType
linestring

Returns

void | Promise<void>


flush()

flush(): Promise<void>;

Defined in: observability/async-writer.ts:64

Drain everything and await the sink — call at run end so the tail isn't lost.

Returns

Promise<void>

Properties

PropertyTypeDefault valueDescriptionDefined in
errorsnumber0Count of write() calls that threw/rejected (isolated, not surfaced).observability/async-writer.ts:35

On this page