You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2022/02/01 18:56:18 UTC

[GitHub] [avro] zcsizmadia edited a comment on pull request #1358: AVRO-3223: Support optional codecs in C# library

zcsizmadia edited a comment on pull request #1358:
URL: https://github.com/apache/avro/pull/1358#issuecomment-1027178601


   @tgnm What is the advantage using a CodecResolver delagate, instaed of assigning a codec to a name at registration time?
   
   Something like this, instead of RegisterResolver, have a RegisterCodec:
   
   ```
   private static readonly ConcurrentDictionary<string, Codec> _registeredCodecs = new ConcurrentDictionary<string, Codec>();
   
   public static void RegisterCodec(string codecString, Codec codec)
   {
       _codecResolvers[codecString] = codec;
   }
   
   public static Codec CreateCodecFromString(string codecType)
   {
       // Check registered codecs
       if (TryGetValue(codecType, out Codec codec))
       {
           return codec;
       }
   
       ...
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org