Sha256: 58ccec55cfb849591a72747f62e4d3d2a3cc523e66822f9f0e8603162dc72697
Contents?: true
Size: 385 Bytes
Versions: 10
Compression:
Stored size: 385 Bytes
Contents
module Jugglite class DeferrableBody include EventMachine::Deferrable def initialize @queue = EM::Queue.new end def write(body) @queue.push(body) end def each(&blk) @body_callback = blk processor = proc { |item| @body_callback.call(item) @queue.pop(&processor) } @queue.pop(&processor) end end end
Version data entries
10 entries across 10 versions & 1 rubygems