Skip to content
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

Move check on zero workers from client constructor to Start #88

Merged
merged 1 commit into from
Dec 2, 2023

Commits on Dec 2, 2023

  1. 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.
    brandur committed Dec 2, 2023
    Configuration menu
    Copy the full SHA
    89fa9f3 View commit details
    Browse the repository at this point in the history