lib/powertrack/streaming/data_buffer.rb
# Add a chunk of bytes to the buffer and pass the new message(s) extracted
# to the block provided.
Add a chunk of bytes to the buffer and pass the new message(s) extracted
to the block provided.
Add a chunk of bytes to the buffer and pass the new message ( s ) extracted to the block provided .
def process(chunk, &block)
      @buffer.concat(chunk)
      @buffer.gsub!(MESSAGE_PATTERN) do |match|
        yield($1.to_s) if block_given?
        ''
      end
    end
def process ( chunk , & block ) @buffer . concat ( chunk ) @buffer . gsub! ( MESSAGE_PATTERN ) do | match | yield ( $1 . to_s ) if block_given? '' end end
Add a chunk of bytes to the buffer and pass the new message(s) extracted
to the block provided.
Add a chunk of bytes to the buffer and pass the new message ( s ) extracted to the block provided .
# erase the message
chunk
block