API Reference
AsyncWriter
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
| Parameter | Type |
|---|---|
write | (lines) => void | Promise<void> |
options | AsyncWriterOptions |
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
| Parameter | Type |
|---|---|
line | string |
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
| Property | Type | Default value | Description | Defined in |
|---|---|---|---|---|
errors | number | 0 | Count of write() calls that threw/rejected (isolated, not surfaced). | observability/async-writer.ts:35 |