( nodeRequest: Http.ClientRequest, request: HttpClientRequest, stream: Stream.Stream<Uint8Array, Error.HttpClientError> )
| 795 | }) |
| 796 | |
| 797 | const sendStream = ( |
| 798 | nodeRequest: Http.ClientRequest, |
| 799 | request: HttpClientRequest, |
| 800 | stream: Stream.Stream<Uint8Array, Error.HttpClientError> |
| 801 | ): Effect.Effect<void, Error.HttpClientError> => |
| 802 | Stream.run( |
| 803 | stream, |
| 804 | NodeSink.fromWritable({ |
| 805 | evaluate: () => nodeRequest, |
| 806 | // The upload fiber owns destruction after observing body failures. |
| 807 | endOnDone: false, |
| 808 | onError: (cause) => |
| 809 | new Error.HttpClientError({ |
| 810 | reason: new Error.TransportError({ |
| 811 | request, |
| 812 | cause |
| 813 | }) |
| 814 | }) |
| 815 | }) |
| 816 | ).pipe(Effect.andThen(() => { |
| 817 | nodeRequest.end() |
| 818 | return waitForFinish(nodeRequest, request) |
| 819 | })) |
| 820 | |
| 821 | /** |
| 822 | * Encodes form data as multipart with the global `Response`, so the encoding |
no test coverage detected