Class: Fluent::StreamInput
- Defined in:
- lib/fluent/plugin/in_stream.rb
Overview
obsolete
Direct Known Subclasses
Defined Under Namespace
Classes: Handler
Constant Summary
Constants included from Configurable
Configurable::CONFIG_TYPE_REGISTRY
Instance Attribute Summary
Attributes inherited from Input
Attributes included from PluginLoggerMixin
Instance Method Summary collapse
-
#initialize ⇒ StreamInput
constructor
A new instance of StreamInput.
-
#run ⇒ Object
def listen end.
- #shutdown ⇒ Object
- #start ⇒ Object
Methods inherited from Input
Methods included from PluginLoggerMixin
Methods included from PluginId
Methods included from Configurable
#config, #configure, included, lookup_type, register_type
Constructor Details
#initialize ⇒ StreamInput
Returns a new instance of StreamInput.
31 32 33 34 35 |
# File 'lib/fluent/plugin/in_stream.rb', line 31 def initialize require 'socket' require 'yajl' super end |
Instance Method Details
#run ⇒ Object
def listen end
54 55 56 57 58 59 |
# File 'lib/fluent/plugin/in_stream.rb', line 54 def run @loop.run(@blocking_timeout) rescue log.error "unexpected error", error: $!.to_s log.error_backtrace end |
#shutdown ⇒ Object
44 45 46 47 48 49 |
# File 'lib/fluent/plugin/in_stream.rb', line 44 def shutdown @loop.watchers.each {|w| w.detach } @loop.stop @lsock.close @thread.join end |
#start ⇒ Object
37 38 39 40 41 42 |
# File 'lib/fluent/plugin/in_stream.rb', line 37 def start @loop = Coolio::Loop.new @lsock = listen @loop.attach(@lsock) @thread = Thread.new(&method(:run)) end |