We have a PR up to Serialize Attachement

We have a PR up to Serialize Attachement back to docs. It will be merged soon
5 Replies
Jun
Jun3w ago
Cloudflare Docs
Using WebSockets · Cloudflare Durable Objects docs
WebSockets are long-lived TCP connections that enable bi-directional, real-time communication between client and server. Both Cloudflare Durable Objects and Workers can act as WebSocket endpoints – either as a client or as a server. Because WebSocket sessions are long-lived, applications commonly use Durable Objects to accept either the client o...
harshil1712
harshil1712OP3w ago
Thank you for adding this back!
Jehu
Jehu3w ago
What is a typical use case for these functions knowing that we have durable object storage? I’m having a hard thinking about scenarios in which it makes sense to use them.
harshil1712
harshil1712OP3w ago
Hey, these functions are used when you are using WebSocket Hibernation API and want to store some state that should survive the hibernation. You can use the persistent storage (KV, SQLite) as well but you would have to write custom logic to attach data for each connection. Eg. serialize attachment can store info like username of the connection. So when the connection wakes up, you can use the same username
Unknown User
Unknown User3w ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server