ActiveCampaign / postmark-dotnet

A .NET library for the Postmark API
http://developer.postmarkapp.com/
Other
50 stars 46 forks source link

Document tread-safety guarantees for PostmarkClient #50

Closed anton-gogolev closed 6 years ago

anton-gogolev commented 7 years ago

I could not find anything with regards to whether PostmarkClient instances are thread-safe or not. Looking through the source code I haven't seen anything immediately non-thread-safe, but I'd still like to get a confirmation straight from the horse's mouth.

atheken commented 7 years ago

I haven't specifically audited the code for thread-safety, but it should be thread safe. PostmarkClient is fairly light-weight, so you should be fine to instantiate one for each request if you're concerned about this.

anton-gogolev commented 6 years ago

Whoopsies, forgot to respond.

As far as I know, the official recommendation is to reuse a single HttpClient across requests (not sure about threads), so reinstantiating a PostmarkClient for each send is somewhat in violation with this guidance.

On 16 Nov 2017, at 16:05, Andrew Theken notifications@github.com wrote:

Closed #50.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.