Cloudflare Developers

CD

Cloudflare Developers

Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news

Join

Output gate and async operations

Why are you concerned about the output gate I'm confused. Can you show a more accurate example? I don't understand the purpose of the psuedo-code you posted, it doesn't do anything

Hey those of you doing web sockets with

Hey those of you doing web sockets with durable objects, how do you authenticate the request to open the websocket? I guess there is no proper standard way of doing it?

Is it possible to use the same DO for

Is it possible to use the same DO for two environments within a worker? I'm seeing this error: ``` - "env.dev" environment configuration...

I can imagine using websocket would be

I can imagine using websocket would be more efficient. We built our previous chat API entirely over HTTP requests and polling, similar analogy. I can't speak to the specifics on a theoretically implementation using DOs as you have described. In production our current use-case necessitated we create a new client ws connection per DO. I don't see how using RPC between DOs would reasonably or efficiently solve the issue....

Let me give an example use case that

Let me give an example use case that demonstrates the issue then. Let's say we are building a cloud storage product, where customers can upload files, and each customer is billed for the total size of all their uploads. Let's build this with DO, where each customer has their own DO which stores the information of total size in SQLite storage. On a request for uploading a file, the DO would: - Upload the file to R2. - Increase the total size in storage....

"Client may still be connected or not".

"Client may still be connected or not". If they are not, how does the response get back to them?... or maybe I misunderstood the original worry?

Is that just by running the constructor

Is that just by running the constructor? What is the instance trying to do when it errors like that

Hmm, are you maybe setting the alarm to

Hmm, are you maybe setting the alarm to run in the constructor? Alternatively, are you calling the alarm() handler directly somewhere in your DO code?

are there any disturbances with durable

are there any disturbances with durable objects? One of objects started throwing errors when opening websockets at 18:30 UTC and it still continues. Other instances work fine. All calls to open a websocket end in a error with some internal code, for example: internal error; reference = keblnpj3s5njtsgrk5tjitk3...

Yes, the requests are simply not

Yes, the requests are simply not connecting from either outside w/ Websockets or inside with RPC

yeah, ive done that but i keep getting

yeah, ive done that but i keep getting Error: internal error

I think that error is relevant to the

I think that error is relevant to the delete you try to do and it probably means the delete doesn't fully go through, or that error causes the deletion to be reverted. I will forward it to the team to investigate more. Your code is correct in terms of the delete code....

deleteAll

Ah, thanks for the alarms thing, didn't know that. Also, I know it's in-memory, but I want to do: ```ts if (config.holdAfterDeletion) { await this.setStatus("reserved");...

Did you notice any extra latency from

Did you notice any extra latency from using the service binding? That’s my only concern with it now

As suggested, using service bindings to

As suggested, using service bindings to call WorkerEntrypoints and Durable Objects from a different worker project is the way, and JS RPC. Also, @gruntlord6 please use properly replies so that the answers you get can be mapped back to the actual original post/thread otherwise it's harder to follow the full discussion of the issue or question when every comment is separate....

i was more confused in the wrangler

i was more confused in the wrangler config with migrations and tags but i managed to figure it out

Build Chat interface

Oh its fairly easy to build a chat interface like that with DOs, I was more asking about architectural/implementation specifics on multiple sockets, any limits I should be aware of etc

CVEs

interesting. if they don't check then disabling dynamic code is useless if you can just deploy a worker from another worker. That said, an MCP server to deploy cloudflare stuff sounds neat

https://developers.cloudflare.com/

https://developers.cloudflare.com/workers/platform/storage-options/ needs to be updated since kv DOs don't have a 50gb per account limit (with sql)

I see that the worker websocket is

I see that the worker websocket is closing the connection every roughly 4.5 mins. Whats the deal with this? I've not run across any documentation which has some information on some kind of timeout.
No description