Skip to content

HttpStreamSession

Defined in: src/client/stream.ts:28

StreamSession implementation for the HTTP transport. Stream state is carried statelessly across requests via an HMAC state token: each HttpStreamSession.exchange or producer-continuation POST sends the current token and receives the next one in the response metadata.

new HttpStreamSession(opts): HttpStreamSession;

Defined in: src/client/stream.ts:46

ParameterType
opts{ authorization?: string; baseUrl: string; compressFn?: CompressFn; compressionLevel?: number; decompressFn?: DecompressFn; externalConfig?: ExternalLocationConfig; finished: boolean; header: Record<string, any> | null; inputSchema?: Schema<any>; method: string; onLog?: (msg) => void; outputSchema: Schema; pendingBatches: RecordBatch<any>[]; postFn?: PostFn; prefix: string; stateToken: string | null; }
opts.authorization?string
opts.baseUrlstring
opts.compressFn?CompressFn
opts.compressionLevel?number
opts.decompressFn?DecompressFn
opts.externalConfig?ExternalLocationConfig
opts.finishedboolean
opts.headerRecord<string, any> | null
opts.inputSchema?Schema<any>
opts.methodstring
opts.onLog?(msg) => void
opts.outputSchemaSchema
opts.pendingBatchesRecordBatch<any>[]
opts.postFn?PostFn
opts.prefixstring
opts.stateTokenstring | null

HttpStreamSession

get header(): Record<string, any> | null;

Defined in: src/client/stream.ts:92

The stream’s one-time header row, or null if the method declares no header.

Record<string, any> | null

The method’s header row (returned once at stream start), or null if the method declares no header.

StreamSession.header

asyncIterator: AsyncIterableIterator<Record<string, any>[]>;

Defined in: src/client/stream.ts:240

Iterate over producer stream batches.

AsyncIterableIterator<Record<string, any>[]>

StreamSession.[asyncIterator]


close(): void;

Defined in: src/client/stream.ts:316

No-op: the HTTP transport is stateless, so there is nothing to tear down.

void

StreamSession.close


exchange(input): Promise<Record<string, any>[]>;

Defined in: src/client/stream.ts:130

Send an exchange request and return the data rows.

ParameterType
inputRecord<string, any>[]

Promise<Record<string, any>[]>

StreamSession.exchange