Class: LogSinks::Pumps::InThreadPump

Inherits:
Object
  • Object
show all
Defined in:
lib/log_sinks/pumps/in_thread_pump.rb

Overview

A pump that drains events to the sink in the current thread

Direct Known Subclasses

DedicatedThreadPump

Instance Method Summary collapse

Constructor Details

#initialize(sink) ⇒ InThreadPump

Returns a new instance of InThreadPump.



7
8
9
# File 'lib/log_sinks/pumps/in_thread_pump.rb', line 7

def initialize(sink)
  @sink = sink
end

Instance Method Details

#receive(event) ⇒ Object



11
12
13
# File 'lib/log_sinks/pumps/in_thread_pump.rb', line 11

def receive(event)
  @sink.drain event
end