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

General refactor of the package #11

Merged
merged 30 commits into from
Jul 10, 2020
Merged

General refactor of the package #11

merged 30 commits into from
Jul 10, 2020

Conversation

prep
Copy link
Owner

@prep prep commented Apr 12, 2020

This PR is a general refactor of the package. It includes the following things:

  • The consumer now only reserves a job when there is a worker ready to accept it. This means that the package no longer offers an exported channel on which you can receive jobs. Instead, everything is handled via the Receive() method.
  • A cancel of the context passed to Receive() will not cancel the in-transit jobs. Instead, those are allowed to finish before Receive() returns.
  • Log messages are now being done by calling a configurable function. This allows the implementer to hook in their preferred logging solution.
  • ProducerPool and ConsumerPool (and their New* functions) are removed in favour of just a Producer and Consumer.
  • The NewProducer and NewConsumer functions will no longer return an error if they were unable to set up a TCP connection to the beanstalk server. This caused problems in scenarios where not all beanstalk servers are available all the time.

@prep prep marked this pull request as ready for review July 10, 2020 12:13
@prep prep merged commit e44071e into master Jul 10, 2020
@prep prep deleted the rework branch July 10, 2020 12:19
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

1 participant