Plugin Helper: Timer
require 'fluent/plugin/input'
module Fluent::Plugin
class ExampleInput < Input
Fluent::Plugin.register_input('example', self)
# 1. Load timer helper
helpers :timer
# Omit `configure`, `shutdown` and other plugin APIs
def start
super
# 2. Execute timer with unique name and second unit interval
timer_execute(:example_timer, 10) {
# ...
}
end
end
endMethods
timer_execute(title, interval, repeat: true, &block)
timer_execute(title, interval, repeat: true, &block)Plugins using timer
timerLast updated
Was this helpful?