asciinema.org/lib/lazy_work_queue.rb

24 lines
421 B
Ruby
Raw Normal View History

2012-06-09 13:23:56 +00:00
# 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