verdverm.com
verdverm.com
Explore posts from servers
PPrisma
Created by verdverm.com on 2/8/2025 in #help-and-questions
Next + Cloudflare Workers + D1
I'm trying to use Prisma in a Next app on Cloudflare Workers and D1. I have gone through all the setup steps and tried to use the ...FORCE_WASM...=1 But on actual deploy, I keep getting fs.readdir not available. My understanding is that this should work, that prisma supports edge runtimes (examples for prisma+d1 exist), and that something is not being built or setup right such that prisma doesn't try to use functions it knows it shouldn't in an edge runtime
40 replies
CDCloudflare Developers
Created by verdverm.com on 1/31/2025 in #general-help
Websockets, Workers, and CPU millis question
I was reading about the Websocket Hibernation on Durable Objects [1] as a way to reduce workload and costs. The note there says that this is for server only, not WS clients, which makes sense. Are there similar strategies for a WS client using something else in the CF product portfolio? If I have an always on WS client, will I be charged for all the CPU milliseconds in a month? Does CF account for how much work my actual worker does vs being idle waiting for a message on a WS connection? My goal is to have a WS client connect to a remote stream [2] and listen forever, but I don't expect a lot of messages. The remote server is outside of my control and only offers WS streams of events. [1] https://developers.cloudflare.com/durable-objects/best-practices/websockets/#websocket-hibernation-api [2] https://developers.cloudflare.com/workers/examples/websockets/#write-a-websocket-client
1 replies