event_loop helper managers event loops.
Here is the code example with
require 'fluent/plugin/input'module Fluent::Pluginclass ExampleInput < InputFluent::Plugin.register_input('example', self)# 1. load event_loop_helperhelpers :event_loop# omit configure, shutdown and other plugin APIdef startsuper# 2. attach watcherwatcher = Coolio::TCPServer.new(...)event_loop_attach(watcher)endendend
Attached watcher is managed by the plugin. No need watcher detach code in plugin's
shutdown. The plugin shutdowns attached watchers automatically.
This method attaches watcher to event loop
If this article is incorrect or outdated, or omits critical information, please let us know. Fluentd is a open source project under Cloud Native Computing Foundation (CNCF). All components are available under the Apache 2 License.