pote / disc

Simple Disque-powered Ruby Jobs
MIT License
129 stars 6 forks source link

Explicit accessors vs DSL #22

Open pote opened 9 years ago

pote commented 9 years ago

The way to add configuration to Disc - Disc::Job#disc - was inspired by Sidekiq's sidekiq_options.

Recently, a discussion in a pull request made me think on wether we want this to be the case, maybe explicit accessors would be better, something along the lines of:

require 'disc'

class CreateGameGrid
  include Disc::Job
  self.queue = 'urgent'

  def perform(type)
    # perform rather lengthy operations here.
  end
end

I find myself growing on the idea, as the Disc job configuration options are simply pieces of data, and it would make sense for it to be manipulated just as you would manipulate any other variable in Ruby.

I would like some more opinions/discussion on it before I implement it though, if anybody has them.

cyx commented 9 years ago

@pote back to ruby? :)

pote commented 9 years ago

@cyx still doing a bit now and then. :)