ActiveCampaign / postmark-java

Official Java client library for the Postmark HTTP API
https://postmarkapp.com
MIT License
35 stars 21 forks source link

Is ApiClient threadsafe? #57

Closed nedtwigg closed 1 year ago

nedtwigg commented 1 year ago

I can't find any documentation specifying whether we can use a single ApiClient instance, or if we need a separate ApiClient for each thread.

ibalosh commented 1 year ago

Hi @nedtwigg

at the moment, thread safety doesn't apply so you would need to use separate client for each thread. I will see to check thread safety options soon.

nedtwigg commented 1 year ago

Thanks! Thread unsafe works just fine, easy to solve with ThreadLocal. Just wanted a doc on what the intent was.

ibalosh commented 1 year ago

Hey @nedtwigg

actually, my assumption seem to have been wrong. The http client used by the library is thread safe. However I did a small release today, version 1.10.21 with small fine tuning to it.

Feel free to use the latest version, and you should be good to go.