Commit 9a8beeb8 authored by Sebastian Korfmann's avatar Sebastian Korfmann
Browse files

Make worker configurable.

parent fe4bb8be
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
class FnordMetric::Worker

  def initialize
  def initialize(opts = {})
    @namespaces = FnordMetric.namespaces
    @opts = FnordMetric.options
    @opts = FnordMetric.options(opts)

    FnordMetric.register(self)
  end
+12 −4
Original line number Diff line number Diff line
@@ -20,6 +20,14 @@ describe FnordMetric::Worker do
    worker.stats_key.should == "fnordmetric-stats"
  end

  context "configurable options" do
    let(:worker) { FnordMetric::Worker.new(:redis_prefix => "fnordmetric-special") }

    it "should include redis prefix" do
      worker.pubsub_key.should == "fnordmetric-special-announce"
    end
  end

  it "should add a namespace"
  it "should add a namespace and pass options"
  it "should add a namespace and the key"