Skip to content

Conversation

@ryansmith3136
Copy link
Contributor

This change will require a major version bump as it has changed the signatures of public methods.

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
ryansmith3136 added a commit that referenced this pull request Jan 5, 2014
@ryansmith3136 ryansmith3136 merged commit 581d9a4 into master Jan 5, 2014
@ryansmith3136 ryansmith3136 deleted the refactorings branch January 5, 2014 23:51
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.

2 participants