Skip to main content

Function: requestWithTimeout()

GalaChain core SDK 1.0.0-rc.8


GalaChain core SDK 1.0.0-rc.8 / index / requestWithTimeout

Function: requestWithTimeout()

requestWithTimeout(requestor, url, options, timeoutMs, kind?): Promise<HTTPResponse>

Defined in: packages/gala-core-sdk/dist/index.d.ts:1889

Sends one request through requestor, aborting it after timeoutMs (REQUEST_TIMEOUT). The caller's own abort passes through as it is. kind: { write: false } marks a read: its REQUEST_TIMEOUT, and a TRANSPORT_ERROR of the default requestors (which cannot tell a read from a write), then say write: false. Without it they are judged as a write's (fail-closed), which is what a write's transport needs before it decides what an unanswered write means.

Parameters​

requestor​

HttpRequestor

url​

string

options​

RequestInit

timeoutMs​

number

kind?​

RequestKind

Returns​

Promise<HTTPResponse>