Hey, did you mean that a value in globalThis will be the same if the DO instances are running in the
Hey, did you mean that a value in globalThis will be the same if the DO instances are running in the same isolate?
workerd a bit, maybe this is of use? https://github.com/cloudflare/workerd/blob/aee8c81a780095b66f80c424545eb5a97a062452/src/workerd/api/workers-module.h#L43this.ctx and this.env but there is some other C++ foo I don't follow if anyone knows?Map copy of the table to look up by PM?ctx.DO.getByname(tenantId).init. However, depending upon why you need it, you may just be able to get away with using ctx.id That address is always accurate and always present. It's that 64 hex digit string that you would use in get(idFromString(id)) or maybe it's the actual id object so you'd use get(id). I let TypeScript tell me when I get it wrong and I'm on mobile so can't try it. routeDORequest expects this format for URLs, [/${prefix}]/${doBindingName}/${doInstanceNameOrId}[/path...]. That's always how my WebSocket upgrades happen so I always have the name in that doInstanceNameOrId slot. There is also an undocumented header (I just added it and it's on my to-do list to document) that has it as well, in case you don't want to parse the URL again inside your DO's fetch handler. Since you have to use fetch for WebSockets and I'm always using WebSockets, I always have those.init() approach, or send the identifier all the time if the original request also contains the information to derive it.agents package has such a system and it's documented, but unfortunately, you have to adopt the somewhat rickety and spotily-documented Agents ecosystem to use it. There is Brayden's elegant Alarm class but it's not documented, and by default requires your DO extend the Actor base class unless you duplicate what that base class does manually. It's still my favorite implementaion and can be found at @cloudflare/actors on npm. And PartyKit has one as well.@lumenize/proxy-fetch which offloads Requests to a Worker or a dedicated DO and then when the fetch is done, it calls back to the original DO and executes a handler that you provided when you made the originalproxyFetch() call.
There is Brayden's elegant Alarm class but it's not documented, and by default requires your DO extend the Actor base class unless you duplicate what that base class does manually.You actually don't need the Actor base class. I am a fan of toolkits personally, so we tried
actors package to make it available on its own, only depending on the ctx.storage of SQLite Durable Objects.cloudflare:testrunDurableObjectAlarm