Module: Fluent::ChunkMessagePackEventStreamer
- Defined in:
- lib/fluent/event.rb
Instance Method Summary collapse
-
#each(unpacker: nil, &block) ⇒ Object
(also: #msgpack_each)
chunk.extend(ChunkMessagePackEventStreamer) => chunk.each{|time, record| … }.
- #to_msgpack_stream(time_int: false, packer: nil) ⇒ Object
Instance Method Details
#each(unpacker: nil, &block) ⇒ Object Also known as: msgpack_each
chunk.extend(ChunkMessagePackEventStreamer)
=> chunk.each{|time, record| ... }
313 314 315 316 317 318 319 320 321 322 |
# File 'lib/fluent/event.rb', line 313 def each(unpacker: nil, &block) # Note: If need to use `unpacker`, then implement it, # e.g., `unpacker.feed_each(io.read, &block)` (Not tested) raise NotImplementedError, "'unpacker' argument is not implemented." if unpacker open do |io| Fluent::MessagePackFactory.msgpack_unpacker(io).each(&block) end nil end |
#to_msgpack_stream(time_int: false, packer: nil) ⇒ Object
325 326 327 328 |
# File 'lib/fluent/event.rb', line 325 def to_msgpack_stream(time_int: false, packer: nil) # time_int is always ignored because data is already packed and written in chunk read end |