Skip to main content
Version: Current

CsvFile

@rotorsoft/act-root


@rotorsoft/act-root / act/src / CsvFile

Class: CsvFile

Defined in: libs/act/src/csv.ts:44

Read end of the transfer pipeline. Anything that exposes a Store.query-shaped reader plus dispose can be used as a source for IAct.restore.

Store extends this interface; the framework's CsvFile utility implements it on top of file I/O so a CSV can be a transfer source. The pipeline never sees a discriminator — both ends speak the same shape.

Implements​

Constructors​

Constructor​

new CsvFile(options): CsvFile

Defined in: libs/act/src/csv.ts:48

Parameters​

options​

CsvFileOptions

Returns​

CsvFile

Methods​

dispose()​

dispose(): Promise<void>

Defined in: libs/act/src/csv.ts:136

Returns​

Promise<void>

Implementation of​

EventSource.dispose


query()​

query<E>(callback, _filter?): Promise<number>

Defined in: libs/act/src/csv.ts:58

Read events into a per-event callback. Adapters MUST await Promise.resolve(callback(event)) per event — sync callbacks resolve immediately (zero overhead), async callbacks throttle the read loop. This is the seam that lets iterate() apply backpressure without changing the callback's declared return type. Callback returns void, which TypeScript treats as "return value ignored" — existing call sites passing e => arr.push(e) (which returns number) keep working.

Type Parameters​

E​

E extends Schemas

Parameters​

callback​

(event) => void

_filter?​

Readonly<{ after?: number; backward?: boolean; before?: number; correlation?: string; created_after?: Date; created_before?: Date; limit?: number; names?: string[]; stream?: string; stream_exact?: boolean; with_pii?: boolean; with_snaps?: boolean; }>

Returns​

Promise<number>

Implementation of​

EventSource.query


restore()​

restore(driver): Promise<void>

Defined in: libs/act/src/csv.ts:101

Parameters​

driver​

(callback) => Promise<void>

Returns​

Promise<void>

Implementation of​

EventSink.restore