Class: Fluent::DebugAgentInput

Inherits:
Input
  • Object
show all
Defined in:
lib/fluent/plugin/in_debug_agent.rb

Constant Summary

Constants included from Configurable

Configurable::CONFIG_TYPE_REGISTRY

Instance Attribute Summary

Attributes inherited from Input

#router

Attributes included from PluginLoggerMixin

#log

Instance Method Summary collapse

Methods included from PluginLoggerMixin

included

Methods included from PluginId

#plugin_id

Methods included from Configurable

#config, included, lookup_type, register_type

Constructor Details

#initializeDebugAgentInput

Returns a new instance of DebugAgentInput.



23
24
25
26
27
# File 'lib/fluent/plugin/in_debug_agent.rb', line 23

def initialize
  require 'drb/drb'
  require 'fluent/plugin/file_util'
  super
end

Instance Method Details

#configure(conf) ⇒ Object



35
36
37
38
39
40
41
42
# File 'lib/fluent/plugin/in_debug_agent.rb', line 35

def configure(conf)
  super
  if @unix_path
    unless ::Fluent::FileUtil.writable?(@unix_path)
      raise ConfigError, "in_debug_agent: `#{@unix_path}` is not writable"
    end
  end
end

#shutdownObject



56
57
58
# File 'lib/fluent/plugin/in_debug_agent.rb', line 56

def shutdown
  @server.stop_service if @server
end

#startObject



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/fluent/plugin/in_debug_agent.rb', line 44

def start
  if @unix_path
    require 'drb/unix'
    uri = "drbunix:#{@unix_path}"
  else
    uri = "druby://#{@bind}:#{@port}"
  end
  log.info "listening dRuby", uri: uri, object: @object
  obj = eval(@object)
  @server = DRb::DRbServer.new(uri, obj)
end