Moshi: Which classes are thread-safe?

Created on 28 Mar 2018  路  2Comments  路  Source: square/moshi

Apologies in advance if this is not the right place for this question.

It is not clear form the documentation (and not clear on an quick glance at the source code) which classes are thread-safe.

Can I share a single Moshi instance between multiple threads?

What about JsonAdapter objects?

Most helpful comment

It will be much better if property documented.

All 2 comments

Moshi and JsonAdapter instances are both immutable and safe for concurrent use.

JsonReader and JsonWriter are not safe for concurrent use.

It will be much better if property documented.

Was this page helpful?
0 / 5 - 0 ratings