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

Always require a client for running a worker #52

Merged
merged 4 commits into from
Mar 24, 2023
Merged

Always require a client for running a worker #52

merged 4 commits into from
Mar 24, 2023

Conversation

fkorotkov
Copy link
Contributor

Otherwise it's getting overriden by the default one

@edigaryev
Copy link
Collaborator

Otherwise it's getting overriden by the default one

Wouldn't it be easier to fix it by just checking if the worker.client is not nil in the Worker's New(), before instantiating a default client?

This way it'd be still possible to instantiate a Worker without additionally instantiating a Client.

Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
@fkorotkov
Copy link
Contributor Author

I though about checking worker.client for nil but IMO explicitly requiring it for creation made me think about it. Otherwise I can see just some options and not pay too much attention to them. But the client is a crucial part of the API and it's not optional. I'd prefer to leave it like that to stress the client being presented.

@fkorotkov fkorotkov enabled auto-merge (squash) March 24, 2023 13:06
@fkorotkov fkorotkov merged commit 362ea85 into main Mar 24, 2023
@fkorotkov fkorotkov deleted the fixes branch March 24, 2023 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants