Class: FluQ::Format::Msgpack

Inherits:
Base
  • Object
show all
Defined in:
lib/fluq/format/msgpack.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#parse

Methods included from Mixins::Loggable

#logger

Constructor Details

#initializeMsgpack

Msgpack initializer

See Also:



16
17
18
19
# File 'lib/fluq/format/msgpack.rb', line 16

def initialize(*)
  super
  @buffer = MessagePack::Unpacker.new
end

Class Method Details

.to_event(raw) ⇒ Object

See Also:



4
5
6
7
8
9
10
11
12
# File 'lib/fluq/format/msgpack.rb', line 4

def self.to_event(raw)
  case raw
  when Hash
    FluQ::Event.new(raw)
  else
    logger.warn "buffer contained invalid event #{raw.inspect}"
    nil
  end
end