Skip to content

Make Sidekiq more Resque compatible#12

Merged
mperham merged 15 commits intosidekiq:masterfrom
maxjustus:master
Feb 10, 2012
Merged

Make Sidekiq more Resque compatible#12
mperham merged 15 commits intosidekiq:masterfrom
maxjustus:master

Conversation

@maxjustus
Copy link
Contributor

Resque always namespaces it's keys either with 'resque:' by default, or with a user defined namespace. So to make Sidekiq compatible with existing Resque installations, I've added namespacing support.

In addition, resque-web uses a set under the 'queues' key to determine which queues to display in it's main dashboard, so I've added a client middleware that adds the queue of the job being queued to that set.

I also refactored all the disparate calls to create redis connections into a single class so there's less repetition.

Thanks for a killer lib!

💰

Max

@mperham
Copy link
Collaborator

mperham commented Feb 10, 2012

This is great, thanks!

I worry that the redis connection code is becoming a tangled web of config logic so I'd like to abstract this into storage adapters but this is a great start.

mperham added a commit that referenced this pull request Feb 10, 2012
Make Sidekiq more Resque compatible
@mperham mperham merged commit e8d3f5b into sidekiq:master Feb 10, 2012
@maxjustus
Copy link
Contributor Author

The only reason I had those ternaries was to silence unnasigned instance variable warnings when running the tests, but yeah I agree they're redundant :)

@fbjork
Copy link
Contributor

fbjork commented Feb 11, 2012

Is there a quick how-to on how to enable the ResqueWebCompatability middleware?

@fbjork
Copy link
Contributor

fbjork commented Feb 11, 2012

I tried the following:

Sidekiq::Client.middleware.register do
  use Sidekiq::Middleware::Client::ResqueWebCompatability
end

which gives: uninitialized constant Sidekiq::Middleware::Client::ResqueWebCompatability (NameError)

@mperham
Copy link
Collaborator

mperham commented Feb 11, 2012

Spelling is fundamental. ;-)

@fbjork
Copy link
Contributor

fbjork commented Feb 11, 2012

I copied from:
https://github.com/mperham/sidekiq/pull/12/files#L6R4

I know it's supposed to be Compatibility, but I copied what I saw:)

@mperham
Copy link
Collaborator

mperham commented Feb 11, 2012

It will be enabled by default in about 30 minutes.

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.

6 participants