Class: Fluent::MessagePackRPCInput

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

Defined Under Namespace

Classes: Server

Instance Method Summary collapse

Constructor Details

#initializeMessagePackRPCInput

Returns a new instance of MessagePackRPCInput.



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

def initialize
  require 'msgpack/rpc'
  super
end

Instance Method Details

#configure(conf) ⇒ Object



31
32
33
34
# File 'lib/fluent/plugin/in_msgpack_rpc.rb', line 31

def configure(conf)
  # TODO: Reject invalid bind parameter
  super
end

#shutdownObject



44
45
46
47
# File 'lib/fluent/plugin/in_msgpack_rpc.rb', line 44

def shutdown
  @server.close
  @thread.join
end

#startObject



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

def start
  @server = MessagePack::RPC::Server.new
  @server.listen @bind, @port, Server.new
  @thread = Thread.new {
    @server.run
  }
end