Class: Fluent::SocketUtil::BaseInput
- Inherits:
-
Input
- Object
- Input
- Fluent::SocketUtil::BaseInput
show all
- Defined in:
- lib/fluent/plugin/socket_util.rb
Constant Summary
Configurable::CONFIG_TYPE_REGISTRY
Instance Attribute Summary
Attributes inherited from Input
#router
#log
Instance Method Summary
collapse
included
Methods included from PluginId
#plugin_id
#config, included, lookup_type, register_type
Constructor Details
Returns a new instance of BaseInput.
94
95
96
97
|
# File 'lib/fluent/plugin/socket_util.rb', line 94
def initialize
super
require 'fluent/parser'
end
|
Instance Method Details
111
112
113
114
115
116
|
# File 'lib/fluent/plugin/socket_util.rb', line 111
def configure(conf)
super
@parser = Plugin.new_parser(@format)
@parser.configure(conf)
end
|
#run ⇒ Object
132
133
134
135
136
137
|
# File 'lib/fluent/plugin/socket_util.rb', line 132
def run
@loop.run(@blocking_timeout)
rescue => e
log.error "unexpected error", error: e, error_class: e.class
log.error_backtrace
end
|
#shutdown ⇒ Object
125
126
127
128
129
130
|
# File 'lib/fluent/plugin/socket_util.rb', line 125
def shutdown
@loop.watchers.each { |w| w.detach }
@loop.stop
@handler.close
@thread.join
end
|
#start ⇒ Object
118
119
120
121
122
123
|
# File 'lib/fluent/plugin/socket_util.rb', line 118
def start
@loop = Coolio::Loop.new
@handler = listen(method(:on_message))
@loop.attach(@handler)
@thread = Thread.new(&method(:run))
end
|