Skip to content

Explicit accessors vs DSL #22

@pote

Description

@pote

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions