lib/em-synchrony/em-jack.rb in em-synchrony-0.1.4 vs lib/em-synchrony/em-jack.rb in em-synchrony-0.1.5

- old
+ new

@@ -1,6 +1,10 @@ -require "em-jack" +begin + require "em-jack" +rescue LoadError => error + raise "Missing EM-Synchrony dependency: gem install em-jack" +end # WANT: namespaced under EventMachine.. would be nice :-) # NOTE: no need for "pooling" since Beanstalk supports pipelining module EMJack class Connection @@ -16,14 +20,14 @@ on_error {|r| f.resume(r)} @used_tube = tube @conn.send(:use, tube) - + # WANT: Add conditional on add_deferrable to either accept two procs, or a single block # .. two procs = callback, errback add_deferrable { |r| f.resume(r) } - + Fiber.yield end end end