QueueClassic/queue_classic

Proposed interface change to QC::Queue

Closed this issue · 4 comments

Currently, the QC::Queue class interface looks like:

  class Queue
    def initialize(name, top_bound=nil)
      @name = name
      @top_bound = top_bound || QC.top_bound
    end

    def conn_adapter=(a)
      @adapter = a
    end

    def conn_adapter
      @adapter ||= QC.default_conn_adapter
    end

I would like to propose that make a breaking change to it. It would become:

  class Queue
    def initialize(name, top_bound: QC.top_bound, conn_adapter: nil)
      @name = name
      @top_bound = top_bound
      @adapter = conn_adapter
    end

   # ...

The main arguments for it are that:

  1. Keyword arguments are more future proof.
  2. We currently support overriding the adapter for a queue, but it needs to be done in 2 different operations for no apparent reasons.

Thoughts?

senny commented

I don't have any objections to specifying the conn_adapter at construction time.

Keyword arguments however are probably not a good fit as we are still supporting earlier versions of Ruby.

I hadn't realized this still supported 1.9.3. We can change to an option hash.

senny commented

@smathieu the README states 1.9.2 and even mentions 1.8.7. However I don't think this is the case anymore.

=> I'm going to remove that from master.

FYI -> https://www.ruby-lang.org/en/news/2014/01/10/ruby-1-9-3-will-end-on-2015/

Ruby 1.9.3 died today? I'm in favor of dropping support for it moving forward.