Milan
CDCloudflare Developers
•Created by 1984 Ford Laser on 1/16/2025 in #durable-objects
Okay this is a dumb one, I think I fixed
Sounds good, I'm actually gonna be out for a bit too, can circle back early Feb 🙂
5 replies
CDCloudflare Developers
•Created by 1984 Ford Laser on 1/16/2025 in #durable-objects
Okay this is a dumb one, I think I fixed
This still seems weird? Maybe I don't properly understand the situation, but if your DO wasn't receiving messages the DO should still hibernate. Unless you just mean your DO was trying to do work but wasn't able to because the WS client had gone away
5 replies
CDCloudflare Developers
•Created by SirStendec on 11/19/2024 in #durable-objects
Hey there. Is there any possibility we
This has come up in the past https://github.com/cloudflare/workerd/issues/958#issuecomment-1665845002, I imagine it's technically feasible, but given the complexity + our other priorities we wouldn't be able to get to this for quite some time. Would this even scale for you though? What if a subscriber was interested in 11 topics, but there are only 10 tags available?
3 replies
CDCloudflare Developers
•Created by lukejacksonn on 10/24/2024 in #durable-objects
Hey 👋 I have a DO based off of this
No worries, happy to help 🙂, good luck building!
18 replies
CDCloudflare Developers
•Created by Mitya on 10/25/2024 in #durable-objects
Hi everyone, I'm new to durable objects
@Mitya this is also useful as a starting point https://blog.cloudflare.com/introducing-workers-durable-objects/
If you're familiar with Cloudflare Workers, you can think of a Durable Object as a special type of worker. Rather than having your requests be handled by any Worker instance, you can have them handled by a particular Durable Object instance. This is what lets you "serialize" (i.e. order requests into a single file line) and "coordinate" (all requests go to the same place) .
Then, you can have a bunch of these individual Durable Object "instances", and can decide where you want to route your requests to.
Since you can route any request to a particular "instance", you can have in-memory state shared between requests. This doesn't work for normal workers because you can't guarantee any 2 requests go to the same worker instance (no way to share memory if you're in different data centers 😉).
Durable Objects also give you access to private local storage through the storage API. If you have any state that isn't ephemeral, you can just write it to DO storage (KV or SQL api -- note this is not Cloudflare KV, which is another product). Anything successfully written to storage is considered durable (we replicate for fault tolerance), so if the machine crashes or your DO is evicted and loses in-memory state, you can read from storage when the next request comes in and you're back to where you were.
3 replies
CDCloudflare Developers
•Created by lukejacksonn on 10/24/2024 in #durable-objects
Hey 👋 I have a DO based off of this
these are "application-level messages", the websocket protocol supports sending protocol level pings (which are invisible to you if you're programming a browser client for example). That's not particularly useful for most people, which is why we let you define an "application-level ping"
18 replies
CDCloudflare Developers
•Created by lukejacksonn on 10/24/2024 in #durable-objects
Hey 👋 I have a DO based off of this
If you set
new WebSocketRequestResponsePair("foo", "bar")
, then have your client (browser, python srcipt, whatever it happens to be) do a ws.send("foo")
, easy as that 🙂18 replies