https.CallableResponse interface
Stay organized with collections
Save and categorize content based on your preferences.
CallableProxyResponse
allows streaming response chunks and listening to signals triggered in events such as a disconnect.
Signature:
export interface CallableResponse<T = unknown>
Properties
Property |
Type |
Description |
sendChunk |
(chunk: T) => Promise<boolean> |
Writes a chunk of the response body to the client. This method can be called multiple times to stream data progressively. Returns a promise of whether the data was written. This can be false, for example, if the request was not a streaming request. Rejects if there is a network error. |
signal |
AbortSignal |
An AbortSignal that is triggered when the client disconnects or the request is terminated prematurely. |
https.CallableResponse.sendChunk
Writes a chunk of the response body to the client. This method can be called multiple times to stream data progressively. Returns a promise of whether the data was written. This can be false, for example, if the request was not a streaming request. Rejects if there is a network error.
Signature:
sendChunk: (chunk: T) => Promise<boolean>;
https.CallableResponse.signal
An AbortSignal
that is triggered when the client disconnects or the request is terminated prematurely.
Signature:
signal: AbortSignal;
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-01-23 UTC.
[null,null,["Last updated 2025-01-23 UTC."],[],[],null,["`CallableProxyResponse` allows streaming response chunks and listening to signals triggered in events such as a disconnect.\n\n**Signature:** \n\n export interface CallableResponse\u003cT = unknown\u003e \n\nProperties\n\nhttps.CallableResponse.sendChunk\n\nWrites a chunk of the response body to the client. This method can be called multiple times to stream data progressively. Returns a promise of whether the data was written. This can be false, for example, if the request was not a streaming request. Rejects if there is a network error.\n\n**Signature:** \n\n sendChunk: (chunk: T) =\u003e Promise\u003cboolean\u003e;\n\nhttps.CallableResponse.signal\n\nAn `AbortSignal` that is triggered when the client disconnects or the request is terminated prematurely.\n\n**Signature:** \n\n signal: AbortSignal;"]]