class BitGirder::Event::File::EventFileLogger

Public Class Methods

start( *argv ) click to toggle source
# File lib/bitgirder/event/file.rb, line 268
def self.start( *argv )
    self.new( *argv ).tap { |l| l.start }
end

Public Instance Methods

event_logged( ev ) click to toggle source
# File lib/bitgirder/event/file.rb, line 255
def event_logged( ev )
    @queue << ev
end
shutdown() click to toggle source
# File lib/bitgirder/event/file.rb, line 260
def shutdown

    @queue << @@shutdown_sentinel
    @worker.join
   
    nil
end
start() click to toggle source
# File lib/bitgirder/event/file.rb, line 250
def start
    @worker = Thread.start { process_queue }
end

Private Instance Methods

impl_initialize() click to toggle source
# File lib/bitgirder/event/file.rb, line 235
def impl_initialize
    @queue = Queue.new
end
process_queue() click to toggle source
# File lib/bitgirder/event/file.rb, line 240
def process_queue
 
    until ( ev = @queue.pop ) == @@shutdown_sentinel
        @writer.write_event( ev )
    end

    @writer.close
end