Skip to content

Commit

Permalink
Fix ChunkMessagePackEventStreamer's invalid argument
Browse files Browse the repository at this point in the history
The argument `unpacker` of `ChunkMessagePackEventStreamer.each`
seems to have been added in order to match the feature with
`EventStream` at c6c6c03.

However, that previous implementation at that point does not
work as expected.
It has never causes any issues just because the argument was not
used at all.

It could be implemented so that this argument is used, but given
that it has not been used so far, there is little need for it.

Signed-off-by: Daijiro Fukuda <[email protected]>
  • Loading branch information
daipom committed Apr 28, 2023
1 parent 0a6d706 commit 8e8f46b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/fluent/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,13 @@ def ensure_decompressed!
end

module ChunkMessagePackEventStreamer
# chunk.extend(ChunkEventStreamer)
# chunk.extend(ChunkMessagePackEventStreamer)
# => chunk.each{|time, record| ... }
def each(unpacker: nil, &block)
open do |io|
(unpacker || Fluent::MessagePackFactory.msgpack_unpacker(io)).each(&block)
# Note: If need to use `unpacker`, then implement it,
# e.g., `unpacker.feed_each(io.read, &block)` (Not tested)
Fluent::MessagePackFactory.msgpack_unpacker(io).each(&block)
end
nil
end
Expand Down

0 comments on commit 8e8f46b

Please sign in to comment.