asciinema.org/lib/lazy_work_queue.rb
2012-06-09 22:49:07 +02:00

24 lines
421 B
Ruby

# Taken from https://github.com/mperham/girl_friday/issues/47
class LazyWorkQueue < GirlFriday::WorkQueue
include Singleton
def self.define *options, &block
Class.new LazyWorkQueue do
define_method :initialize do
super *options do |info|
block.call
end
end
end
end
def self.push *args
instance.push *args
end
def self.status
instance.status
end
end