Class: Fluent::StreamInput

Inherits:
Input
  • Object
show all
Defined in:
lib/fluent/plugin/in_stream.rb

Overview

obsolete

Direct Known Subclasses

UnixInput

Defined Under Namespace

Classes: Handler

Instance Attribute Summary

Attributes included from Configurable

#config

Instance Method Summary collapse

Methods inherited from Input

#configure

Methods included from PluginId

#configure, #plugin_id, #require_id

Methods included from Configurable

#configure, included

Constructor Details

#initializeStreamInput

Returns a new instance of StreamInput.



23
24
25
26
27
# File 'lib/fluent/plugin/in_stream.rb', line 23

def initialize
  require 'socket'
  require 'yajl'
  super
end

Instance Method Details

#runObject

def listen end



47
48
49
50
51
52
# File 'lib/fluent/plugin/in_stream.rb', line 47

def run
  @loop.run
rescue
  $log.error "unexpected error", :error=>$!.to_s
  $log.error_backtrace
end

#shutdownObject



37
38
39
40
41
42
# File 'lib/fluent/plugin/in_stream.rb', line 37

def shutdown
  @loop.watchers.each {|w| w.detach }
  @loop.stop
  @lsock.close
  @thread.join
end

#startObject



29
30
31
32
33
34
35
# File 'lib/fluent/plugin/in_stream.rb', line 29

def start
  @loop = Coolio::Loop.new
  @lsock = listen
  @loop.attach(@lsock)
  @thread = Thread.new(&method(:run))
  @cached_unpacker = MessagePack::Unpacker.new
end