Merged
Conversation
This lib does not use these methods. If a client is calling these methods, that code should be removed.
The primary motivation behind this feature was to expose a path for dealing with multiple database connections within a single process. Specifically, I wanted to test the worker's ability to block on a LISTEN and subsequently wait when another connection had issued a NOTIFY. This was not possible with our global Conn module. This change has introduced a new abstraction known as the ConnAdapter. The ConnAdapter is explicity set on the Queue. The adapter simply wraps a few commands around an instance of a PG::Connection. The adapter was also designed so that clients can pass their active record connections to the wraper for cases when you want to share a connection between queue_classic and a rails app.
Even if the worker will be responsible for many queues, it should not maintain a seperate database connection for each queue.
This change also provides a correct test for the worker's ability to wait. Previous test was completely wrong. cc: @collin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change will require a major version bump as it has changed the signatures of public methods.