Plugin Helper: Thread
require 'fluent/plugin/output'
module Fluent::Plugin
class ExampleOutput < Output
Fluent::Plugin.register_output('example', self)
# 1. Load thread helper
helpers :thread
# Omit `configure`, `shutdown` and other plugin APIs
def start
super
# 2. Create and run thread with unique name.
thread_create(:example_thread_run, &method(:run))
end
def run
# ...
end
end
endMethods
thread_create(title)
thread_create(title)thread_current_running?
thread_current_running?Plugins using thread
threadLast updated
Was this helpful?