Sha256: 901b2a1e4d2f16be233414f8f2075d4fd488045ea2b19ba067c4a8d316851a20
Contents?: true
Size: 446 Bytes
Versions: 21
Compression:
Stored size: 446 Bytes
Contents
module Unipept class BatchOrder attr_reader :order def initialize @order = {} @current = 0 end def wait(i, &block) if i == @current # start writing + those who have been waiting as well block.call @current += 1 while order[@current] order.delete(@current).call @current += 1 end else @order[i] = block end end end end
Version data entries
21 entries across 21 versions & 1 rubygems