44 lines
No EOL
2 KiB
TypeScript
44 lines
No EOL
2 KiB
TypeScript
/**
|
|
* @module botframework-streaming
|
|
*/
|
|
/**
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License.
|
|
*/
|
|
import { SubscribableStream } from '../subscribableStream';
|
|
import { StreamManager } from './streamManager';
|
|
import { IHeader, IReceiveResponse, IReceiveRequest } from '../interfaces';
|
|
/**
|
|
* Orchestrates assembly of payloads.
|
|
*/
|
|
export declare class PayloadAssemblerManager {
|
|
private readonly streamManager;
|
|
private readonly onReceiveResponse;
|
|
private readonly onReceiveRequest;
|
|
private readonly activeAssemblers;
|
|
/**
|
|
* Initializes a new instance of the [PayloadAssemblerManager](xref:botframework-streaming.PayloadAssemblerManager) class.
|
|
*
|
|
* @param streamManager The [StreamManager](xref:botframework-streaming.StreamManager) managing the stream being assembled.
|
|
* @param onReceiveResponse Function that executes when new bytes are received on a `response` stream.
|
|
* @param onReceiveRequest Function that executes when new bytes are received on a `request` stream.
|
|
*/
|
|
constructor(streamManager: StreamManager, onReceiveResponse: (id: string, receiveResponse: IReceiveResponse) => Promise<void>, onReceiveRequest: (id: string, receiveRequest: IReceiveRequest) => Promise<void>);
|
|
/**
|
|
* Retrieves the assembler's payload as a stream.
|
|
*
|
|
* @param header The Header of the Stream to retrieve.
|
|
* @returns A [SubscribableStream](xref:botframework-streaming.SubscribableStream) of the assembler's payload.
|
|
*/
|
|
getPayloadStream(header: IHeader): SubscribableStream;
|
|
/**
|
|
* The action the assembler executes when new bytes are received on the incoming stream.
|
|
*
|
|
* @param header The stream's Header.
|
|
* @param contentStream The incoming stream being assembled.
|
|
* @param contentLength The length of the stream, if finite.
|
|
*/
|
|
onReceive(header: IHeader, contentStream: SubscribableStream, contentLength: number): void;
|
|
private createPayloadAssembler;
|
|
}
|
|
//# sourceMappingURL=payloadAssemblerManager.d.ts.map
|