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
We are creating only one instance of the SendGrid class using the API Key of each subuser we have, and the send method which make the SendGrid request can be accessed by any of the threads we have, so is this thread safe? is there any problem for using it that way ? I mean reusing the same SendGrid instance from multiple threads ?
@kamelsalah92 The API is fully thread safe and can be used in that manner. Under the hood, we are using this HTTP connection manager. It is thread safe, however, it effectively synchronizes across threads, i.e., multiple threads cannot execute concurrently.
@thinkingserious With minimal changes, we could add the ability to handle multiple concurrent actions using this. But I'm assuming that will be a separate issue opened up.
Activity
thinkingserious commentedon Aug 14, 2017
Hello @kamelsalah92,
This library has not been tested for thread safety. I would recommend extensive testing if you wish to use the library in this way.
With Best Regards,
Elmer
andy-trimble commentedon Oct 10, 2017
@kamelsalah92 The API is fully thread safe and can be used in that manner. Under the hood, we are using this HTTP connection manager. It is thread safe, however, it effectively synchronizes across threads, i.e., multiple threads cannot execute concurrently.
@thinkingserious With minimal changes, we could add the ability to handle multiple concurrent actions using this. But I'm assuming that will be a separate issue opened up.