Module: Fluent::PluginHelper::EventEmitter
- Defined in:
- lib/fluent/plugin_helper/event_emitter.rb
Instance Method Summary collapse
- #after_shutdown ⇒ Object
-
#close ⇒ Object
unset router many times to reduce test cost.
- #configure(conf) ⇒ Object
- #event_emitter_router(label_name) ⇒ Object
- #event_emitter_used_actually? ⇒ Boolean
- #has_router? ⇒ Boolean
- #initialize ⇒ Object
-
#router ⇒ Object
stop : [-] shutdown : disable @router close : [-] terminate: [-].
- #router=(r) ⇒ Object
- #terminate ⇒ Object
Instance Method Details
#after_shutdown ⇒ Object
64 65 66 67 |
# File 'lib/fluent/plugin_helper/event_emitter.rb', line 64 def after_shutdown @router = nil super end |
#close ⇒ Object
unset router many times to reduce test cost
69 70 71 72 |
# File 'lib/fluent/plugin_helper/event_emitter.rb', line 69 def close # unset router many times to reduce test cost @router = nil super end |
#configure(conf) ⇒ Object
58 59 60 61 62 |
# File 'lib/fluent/plugin_helper/event_emitter.rb', line 58 def configure(conf) require 'fluent/engine' super @router = event_emitter_router(conf['@label']) end |
#event_emitter_router(label_name) ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/fluent/plugin_helper/event_emitter.rb', line 44 def event_emitter_router(label_name) if label_name Engine.root_agent.find_label(label_name).event_router else Engine.root_agent.event_router end end |
#event_emitter_used_actually? ⇒ Boolean
40 41 42 |
# File 'lib/fluent/plugin_helper/event_emitter.rb', line 40 def event_emitter_used_actually? @_event_emitter_used_actually end |
#has_router? ⇒ Boolean
36 37 38 |
# File 'lib/fluent/plugin_helper/event_emitter.rb', line 36 def has_router? true end |
#initialize ⇒ Object
52 53 54 55 56 |
# File 'lib/fluent/plugin_helper/event_emitter.rb', line 52 def initialize super @_event_emitter_used_actually = false @router = nil end |
#router ⇒ Object
stop : [-] shutdown : disable @router close : [-] terminate: [-]
27 28 29 30 |
# File 'lib/fluent/plugin_helper/event_emitter.rb', line 27 def router @_event_emitter_used_actually = true @router end |
#router=(r) ⇒ Object
32 33 34 |
# File 'lib/fluent/plugin_helper/event_emitter.rb', line 32 def router=(r) @router = r end |
#terminate ⇒ Object
74 75 76 77 |
# File 'lib/fluent/plugin_helper/event_emitter.rb', line 74 def terminate @router = nil super end |