You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can I using different Decoder / Encoder of same type at a time ?
Example:
I have a API for export/import a data of class X:
{ "name": "ndhcoder", "age": 18 }
I need optimize storage so I'm using my customize decoder / encoder for minify field name of data to
{ "a": "ndhcoder", "b": 18 }
But in others API, X must be in a normal format:
{ "name": "ndhcoder", "age": 18 }
If I register decoder / encoder type at start time, I can't do both features. If I register decoder / encoder at the start time of each API, seem very confuse on multithreading, How do I resolve this problem ?
Thanks all
The text was updated successfully, but these errors were encountered:
ndhcoder
changed the title
Using different Decoder / Encoder of same type at a time
Using different Decoder / Encoder of same type at a same time
Jan 24, 2022
@ndhcoder Hi, can you please share what was the resolution of the issue?
JsonStream cache the Config object that extends EmptyExtension class (I will implement method createEncoder / Decoder for this config if I need my customize encoder/decoder) inside a ThreadLocal, So I just need create an Config and then pass it into JsonStream.seralize(config, object). By default, on each thread, JsonStream using same instance Config if not specified, so If I create one then other thread not side effect.
Hello everyone,
Can I using different Decoder / Encoder of same type at a time ?
Example:
I have a API for export/import a data of class X:
{ "name": "ndhcoder", "age": 18 }
I need optimize storage so I'm using my customize decoder / encoder for minify field name of data to
{ "a": "ndhcoder", "b": 18 }
But in others API, X must be in a normal format:
{ "name": "ndhcoder", "age": 18 }
If I register decoder / encoder type at start time, I can't do both features. If I register decoder / encoder at the start time of each API, seem very confuse on multithreading, How do I resolve this problem ?
Thanks all
The text was updated successfully, but these errors were encountered: