lib/avromatic/messaging.rb in avromatic-0.14.0.rc1 vs lib/avromatic/messaging.rb in avromatic-0.14.0
- old
+ new
@@ -1,10 +1,10 @@
require 'avro_turf/messaging'
require 'avromatic/io/datum_reader'
module Avromatic
- # Subclass AvroTurf::Messaging to use a custom DatumReader
+ # Subclass AvroTurf::Messaging to use a custom DatumReader for decode.
class Messaging < AvroTurf::Messaging
def decode(data, schema_name: nil, namespace: @namespace)
readers_schema = schema_name && @schema_store.find(schema_name, namespace)
stream = StringIO.new(data)
decoder = Avro::IO::BinaryDecoder.new(stream)
@@ -22,10 +22,10 @@
writers_schema = @schemas_by_id.fetch(schema_id) do
schema_json = @registry.fetch(schema_id)
@schemas_by_id[schema_id] = Avro::Schema.parse(schema_json)
end
- # The following line was changed to use a custom DatumReader
+ # The following line differs from the parent class to use a custom DatumReader
reader = Avromatic::IO::DatumReader.new(writers_schema, readers_schema)
reader.read(decoder)
end
end
end