Sha256: cd2ef5ea95ae9657a375220178c02d677e9d3071b34160e19eefffd4856e8986
Contents?: true
Size: 774 Bytes
Versions: 1
Compression:
Stored size: 774 Bytes
Contents
module Sideband class Manager def initialize @pid = ::Process.pid thread! queue! end def queue handle_fork handle_dead_thread @queue end def thread @thread end def join @queue.kill @thread.join end def kill @thread.kill @thread = @queue = nil end private def queue! @queue = Sideband::Queue.new end def thread! @thread.kill if @thread @thread = Sideband::Thread.new(self) end def handle_fork if ::Process.pid != @pid @pid = ::Process.pid thread! queue! end end def handle_dead_thread if @thread && @thread.thread.alive? thread! end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sideband-1.0.3 | lib/sideband/manager.rb |