arangodb-net-standard icon indicating copy to clipboard operation
arangodb-net-standard copied to clipboard

Thread safety

Open HypeillingerChillinger opened this issue 3 years ago • 1 comments

Are ArangoDBClient and HttpApiTransport thread safe? I cannot find any information about that in the documentation.

So can they safely be cached and used in different threads or do I need a factory for them?

HypeillingerChillinger avatar Aug 22 '22 09:08 HypeillingerChillinger

Hi @HypeillingerChillinger ,

ArangoDBClient and HttpApiTransport should be thread safe. They are as thread safe as the underling transport implementation, which is HttpClient by default.

So can they safely be cached and used in different threads

Yes. On a project I'm working on, we have a single instance of ArangoDBClient used by different threads in an ASP.NET (.NET Framework) application, and it works fine. As long as your initialization logic is thread safe as well.

DiscoPYF avatar Aug 28 '22 11:08 DiscoPYF

Closing issue as it seems to be answered by DiscoPYF

rossmills99 avatar Jan 16 '23 12:01 rossmills99