mperham/sidekiq — pull request #524 by karlfreeman (2012-11-15 21:13:55+00:00)
Title: Allow Sidekiq::Client to push / push_bulk job with class as a String

This patch would allow Sidekiq::Client's the ability to push jobs without needing class definition loaded, eg from a different code base.

### Reasoning

I'm looking to move over to Sidekiq but have separate code bases that need to create jobs ( read, no rails ). This would allow these code bases to create jobs without knowing about the workers that execute them

```
# In a process, far far away

# Configure client
Sidekiq.configure_client do |config|
config.redis = { :url => 'redis://redis.example.com:7372/12', :namespace => 'mynamespace' }
end

# Push jobs without class definition
Sidekiq::Client.push('class' => 'Example::Workers::Trace', 'args' => ['hello!'])

# Push jobs overriding default's
Sidekiq::Client.push('queue' => 'example', 'retry' => 3, 'class' => 'Example::Workers::Trace', 'args' => ['hello!'])

```

### Side-effects of using String class

- Class method defined defaults do not get loaded ( eg no way to query for `get_sidekiq_options` when the class is not loaded )
- Allows for jobs to be created for classes that 'may' exist
- Modifies logic

Thoughts?