disc icon indicating copy to clipboard operation
disc copied to clipboard

Explicit accessors vs DSL

Open pote opened this issue 10 years ago • 2 comments

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.

pote avatar Aug 18 '15 23:08 pote

@pote back to ruby? :)

cyx avatar Aug 24 '15 18:08 cyx

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

pote avatar Aug 24 '15 18:08 pote