Skip to content

Commit

Permalink
Clarifying language on serializeAttachment method.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oxyjun committed Dec 4, 2024
1 parent 1012ba5 commit 26a7a44
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ If you are using older versions, note that while hibernatable WebSocket events s

- <code> serializeAttachment(value <Type text="any" />)</code>: <Type text="void" />

- Keeps a copy of `value` in memory (not on disk) to survive hibernation. The value can be any type supported by the [structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), which is true of most types.
- Keeps a copy of `value` associated with the WebSocket to survive hibernation. The value can be any type supported by the [structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm), which is true of most types. If the value needs to be durable please use [Durable Object Storage](/durable-objects/api/storage-api/).

- If you modify `value` after calling this method, those changes will not be retained unless you call this method again. The serialized size of `value` is limited to 2,048 bytes, otherwise this method will throw an error. If you need larger values to survive hibernation, use the [Storage API](/durable-objects/api/storage-api/) and pass the corresponding key to this method so it can be retrieved later.

Expand Down

0 comments on commit 26a7a44

Please sign in to comment.