Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move check on zero workers from client constructor to
Start
This one's in pursuit of trying to solve #87, where it's difficult to inject a River client into a worker because trying to initialize a client with the workers bundle empty is an error, creating a chicken and egg problem. There's no real reason to disallow a zero worker bundle from the constructor, and in fact a lot of our tests already add additional workers after the client was originally initialized (although `newTestClient` injects a default worker, which is why there's no error). If it's a useful pattern for us, it's probably useful for other users too. Here, move the zero workers check from the constructor over to the `Start` function instead. While it seems okay to initialize a client without workers, starting it without any does seem like a potential problem that we'd want to keep an eye out for. Fixes #87.
- Loading branch information