Of course : )

Of course : ) So basically I want to locally debug the queue producer and queue consumer. The queue producer is a cloudflare pages app, built on Remix. The queue consumer is a worker with plain typescript, no framework. I kept the worker that simple intentionally because it doesn't need database access or routing or whatever, it's basically a proxy for queue consumption (because cloudflare pages apps can't consume from a queue yet and other limitations). If it was possible, I would use only the pages app as the producer and consumer. But my solution with having a separate consumer and producer is really not even what I want, but cloudflare's restriction of me not being able to use pages for everything means I need to split queue production and consumption. I can't put the queue consumption into the pages app because pages apps can't be consumers. I can't put the queue production into the worker script because I don't have access to database and everything there. Currently I just have a route on the pages app that I use as a workaround, but not being able to locally test pages<->workers communication via a queue is not nice
5 Replies
Unknown User
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
divby0
divby0OP•15mo ago
The most important use case: I have a pages fullstack app and I want it to send out a specific report for each user on sunday. The exact time is not important so with the current state, I have to go through hoops. This is my plan for when pages would be able to consume from queue AND get scheduled/cron events (like workers) Cron triggers a pages route -> pages app fetches all users from db and pushes an element {id: <userid>} into the queue for each user -> pages app then consumes from the queue one-by-one, creates a report for the given user and sends it to them. This way I can make sure every user gets one report without missing a user or sending double.
forslunds
forslunds•15mo ago
Feeling the same pain! Fullstack remix pages. Need to rate-limit backgroundjobs. (Using GCT instead) The only workaround as described above is not a solution on dev 😦
Unknown User
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
divby0
divby0OP•15mo ago
also, another of my use cases is being able to just do something in the background that the user started (for example LLM generation, should be a pretty current and popular example).
Want results from more Discord servers?
Add your server