Sha256: dfed544f918c65681f60dd40ab14a1b498a61a407f6f46d7e6e6cd9194777b77

Contents?: true

Size: 444 Bytes

Versions: 1

Compression:

Stored size: 444 Bytes

Contents

module Wukong
  module Streamer
    #
    #
    # Note: it's on you to `require 'json'` somewhere (there's too many 
    class JsonStreamer < Wukong::Streamer::Base

      #
      # Parses the incoming record as JSON, returns a single arg to #process
      #
      def recordize line
        begin
          [JSON.parse(line)]
        rescue StandardError => boom
          bad_record!(boom, line.to_s)
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wukong-3.0.0.pre old/wukong/streamer/json_streamer.rb