-
Notifications
You must be signed in to change notification settings - Fork 749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🚀 Feature Request: Multiple workers support + shared resources #4452
Comments
Hey @iustinpericica! 👋 For developing multiple workers locally with access to shared bindings, I would encourage you to use Miniflare's API directly. See the example on this page https://miniflare.dev/core/multiple-workers and the API docs here https://github.com/cloudflare/workers-sdk/blob/main/packages/miniflare/README.md. You should be able to get this working with Wrangler too though. Start a |
hi @iustinpericica ! we haven't heard from you in a while, so we’re going to close this issue for now. if this is still a problem, please feel free to open a new issue referencing this one. please be sure to include an updated summary and any additional requested details, followup, or context and we will revisit and investigate further. thanks! |
2024 now, any new official advice how to let multiple workers access the same d1 database? Monorepo? |
@BerndWessels here's how I did it in a monorepo based on what @mrbbot mentioned, it seems to be working fine though I haven't had a lot of time for testing yet. I have two apps in my monorepo, one is a Pages app (in The Worker app now seems to open and read/write from the same DB as the Pages app without issue. |
Describe the solution
I'm trying to set up locally few workers that access shared resources like D1, KV in prod env.
Let's take an example to make things easier.
WorkerA with access to D1_A, KV_A, KV_B
WorkerB with access to D1_A, KV_B.
I'm struggling to set up proper development experience which is to start multiple workers with wrangler, make the bindings to each of them work and most important, share the database resources between each other ( WorkerA and WorkerB point to same instance of KV_B and D1_A and not set one resource instance/ worker ).
Without the possibility of sharing resources and make the bindings work, it is impossible to properly develop locally an application in such scenario?
The text was updated successfully, but these errors were encountered: