Sha256: 91d2e672284817ddcc3236b160c83e8624754be2dbf6deadce6d33014063f9df

Contents?: true

Size: 561 Bytes

Versions: 3

Compression:

Stored size: 561 Bytes

Contents

require 'celluloid'
require 'sucker_punch/exceptions'
require 'sucker_punch/queue'
require 'sucker_punch/worker'
require 'sucker_punch/version'

module SuckerPunch
  extend self

  def config(&block)
    instance_eval &block
  end

  def queue(options = {})
    raise MissingQueueName unless options[:name]
    raise MissingWorkerName unless options[:worker]

    klass         = options.fetch(:worker)
    registry_name = options.fetch(:name)
    size          = options.fetch(:size, nil)

    q = Queue.new(registry_name)
    q.register(klass, size)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sucker_punch-0.3.1 lib/sucker_punch.rb
sucker_punch-0.3 lib/sucker_punch.rb
sucker_punch-0.2 lib/sucker_punch.rb