Is there a simple way to use Cloudflare Durable Objects/Workflows/etc ATM? #3099
Replies: 2 comments 4 replies
-
YES. via the Nitro has a decent/zeroconfig integrated WebSocket API (via crossws) compatible with Durable Objects which is a replacement for partyserver, if you have any feedback about improving this layer, it is more than welcome. In addition to WebSockets, #3048 (available in the nightly channel) enables Durable Objects to handle any route and access to class instance and Durable storage/db. In the next steps, we plan to also expose an API to access custom durable object instances from the main server + ability to communicate with it via RPC to improve flexibility. Since the output of each project is "one server bundle", there will be only one durable object class (with multiple instances) with the ability to communicated via RPC. Usage of Durable Objects is different in Nitro (but much much much simpler + pluggable) than what cloudflare DX offers and I value your feedback about any limitations you might be facing (from this different API). |
Beta Was this translation helpful? Give feedback.
-
I know there's some work in progress at the moment, but it doesn't have to be perfect. Is there a vendor locked way to define the durable objects/workflow classes myself and have them work through the bindings
event.context.cloudflare.env.MyServer
, and only use Nitro to define the routes for the worker entrypoint?I got it to a state that at least it starts without errors (using custom preset as suggested in the docs), but it doesn't support durable objects rpc calls and I'm also struggling with the websocket part.
I spent many hours trying to figure out how to do any of this, but got more confused as time passed.
I wanted to create a simple Nuxt PartyKit Starter, similar to what I have done with Vue here:
https://github.com/franciscohermida/partyvite-vue
Is this not possible at all even as a temporary hybrid thing?
Beta Was this translation helpful? Give feedback.
All reactions