Skip to content

Commit

Permalink
Add Notes about Type Expections about Worker's Socket API
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaokangwang committed May 26, 2023
1 parent b85a305 commit 3b0d3c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ await someResponse.body.pipeTo(writable);
- {{<code>}}write(chunk{{<param-type>}}any{{</param-type>}}){{</code>}} : {{<type>}}Promise\<void>{{</type>}}

- Writes a chunk of data to the writer and returns a promise that resolves if the operation succeeds.
- The underlaying stream may accept fewer kinds of type than `any`, it will throw an exception when encountering an unexpected type.

{{</definitions>}}

Expand Down
1 change: 1 addition & 0 deletions content/workers/runtime-apis/tcp-sockets.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export default {

- {{<code>}}writeable{{</code>}} : {{<type-link href="/workers/runtime-apis/streams/writablestream/">}}WriteableStream{{</type-link>}}
- Returns the writable side of the TCP socket.
- The `WriteableStream` returned only accept chunks of `Uint8Array` or its views.

- `closed` {{<type>}}`Promise<void>`{{</type>}}
- This promise is resolved when the socket is closed and is rejected if the socket encounters an error.
Expand Down

0 comments on commit 3b0d3c1

Please sign in to comment.