Reputation: 41
I'm new to this. I'm working with ElasticClient (.Net) and I was curious if:
Thanks!
Bob
Upvotes: 4
Views: 3089
Reputation: 1233
On thread safety: https://github.com/elastic/elasticsearch-net/issues/23
The ElasticClient holds a single IConnection responsible for doing async and sync http calls. The IConnection does not reuse httprequests and uses thread local state for data thats being passed around during the stages of the request. It should thus be thread safe.
On disposing: https://github.com/elastic/elasticsearch-net/issues/101
ElasticClient is almost stateless except for a static CLR type info cache that is threadsafe so you can even use one client over threads. Disposing is also handled by Nest and ElasticClient only exposes POCO's.
Upvotes: 3