You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running multiple workers locally, the first wrangler process to start becomes the host for the dev registry. All other wrangler processes then register their workers with this "leader" process/registry.
This can lead to some confusing development situations where the order of operations is important. For example, if I shut down or restart that initial wrangler process, the registry is lost and all of my other workers have to be restarted in order to re-create it. I didn't realize this is how it worked until I took a deeper look at the workers sdk source.
Describe the solution
Instead of a transient store, it would be preferable if each wrangler process can register its workers in a registry that is independent of which process is actually running.
I imagine that this might be a file structure on disk. Something like ~/.wrangler/registry. Each process can register its workers there on startup and then clean them up on shutdown. This enables wrangler processes to start and stop at will without worrying about order of execution. It also provides more reliable linking of services during local development.
It might also be useful if the registry could contain pointers to workers running remotely in Cloudflare in order to enable mixed-mode development.
Hey! 👋 I've got a WIP PR that does something similar to this: #4241. Instead of treating the first process as the "leader", the first process will spawn a background daemon registry process that will outlive it if other wrangler dev sessions are still running. We prioritised some other dev-related work, so wasn't able to land this back then, but hoping to revisit this soon. 👍
Problem
When running multiple workers locally, the first wrangler process to start becomes the host for the dev registry. All other wrangler processes then register their workers with this "leader" process/registry.
This can lead to some confusing development situations where the order of operations is important. For example, if I shut down or restart that initial wrangler process, the registry is lost and all of my other workers have to be restarted in order to re-create it. I didn't realize this is how it worked until I took a deeper look at the workers sdk source.
Describe the solution
Instead of a transient store, it would be preferable if each wrangler process can register its workers in a registry that is independent of which process is actually running.
I imagine that this might be a file structure on disk. Something like
~/.wrangler/registry
. Each process can register its workers there on startup and then clean them up on shutdown. This enables wrangler processes to start and stop at will without worrying about order of execution. It also provides more reliable linking of services during local development.It might also be useful if the registry could contain pointers to workers running remotely in Cloudflare in order to enable mixed-mode development.
Related to #1182
The text was updated successfully, but these errors were encountered: