Refactorings by ryansmith3136 · Pull Request #190 · QueueClassic/queue_classic
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.