Sha256: 6834c5ca28f8012fcb39605a4e9dc7c276de431ae50274704bd05ef1f071107c
Contents?: true
Size: 467 Bytes
Versions: 11
Compression:
Stored size: 467 Bytes
Contents
module Listen # @private api module Internals # Just a wrapper for tests to avoid interfereing with Celluloid's threads module ThreadPool def self.add(&block) (@threads ||= Queue.new) << Thread.new { block.call } end def self.stop return unless @threads ||= nil killed = Queue.new killed << @threads.pop.kill until @threads.empty? killed.pop.join until killed.empty? end end end end
Version data entries
11 entries across 11 versions & 2 rubygems