You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/api/Dispatcher.md
+6-8Lines changed: 6 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -205,14 +205,12 @@ Returns: `Boolean` - `false` if dispatcher is busy and further dispatch calls wo
205
205
206
206
#### Parameter: `DispatchHandler`
207
207
208
-
***onConnect**`(abort: () => void, context: object) => void` - Invoked before request is dispatched on socket. May be invoked multiple times when a request is retried when the request at the head of the pipeline fails.
209
-
***onError**`(error: Error) => void` - Invoked when an error has occurred. May not throw.
210
-
***onUpgrade**`(statusCode: number, headers: Buffer[], socket: Duplex) => void` (optional) - Invoked when request is upgraded. Required if `DispatchOptions.upgrade` is defined or `DispatchOptions.method === 'CONNECT'`.
211
-
***onResponseStarted**`() => void` (optional) - Invoked when response is received, before headers have been read.
212
-
***onHeaders**`(statusCode: number, headers: Buffer[], resume: () => void, statusText: string) => boolean` - Invoked when statusCode and headers have been received. May be invoked multiple times due to 1xx informational headers. Not required for `upgrade` requests.
213
-
***onData**`(chunk: Buffer) => boolean` - Invoked when response payload data is received. Not required for `upgrade` requests.
214
-
***onComplete**`(trailers: Buffer[]) => void` - Invoked when response payload and trailers have been received and the request has completed. Not required for `upgrade` requests.
215
-
***onBodySent**`(chunk: string | Buffer | Uint8Array) => void` - Invoked when a body chunk is sent to the server. Not required. For a stream or iterable body this will be invoked for every chunk. For other body types, it will be invoked once after the body is sent.
208
+
***onRequestStart**`(controller: DispatchController, context: object) => void` - Invoked before request is dispatched on socket. May be invoked multiple times when a request is retried when the request at the head of the pipeline fails.
209
+
***onRequestUpgrade**`(controller: DispatchController, statusCode: number, headers: Record<string, string | string[]>, socket: Duplex) => void` (optional) - Invoked when request is upgraded. Required if `DispatchOptions.upgrade` is defined or `DispatchOptions.method === 'CONNECT'`.
210
+
***onResponseStart**`(controller: DispatchController, statusCode: number, statusMessage?: string, headers: Record<string, string | string []>) => boolean` - Invoked when statusCode and headers have been received. May be invoked multiple times due to 1xx informational headers. Not required for `upgrade` requests.
211
+
***onResponseData**`(controller: DispatchController, chunk: Buffer) => boolean` - Invoked when response payload data is received. Not required for `upgrade` requests.
212
+
***onResponseEnd**`(controller: DispatchController, trailers: Record<string, string | string[]>) => void` - Invoked when response payload and trailers have been received and the request has completed. Not required for `upgrade` requests.
213
+
***onResponseError**`(error: Error) => void` - Invoked when an error has occurred. May not throw.
0 commit comments