Mpdreamz/NEST — Issue #23: Thread safety
Author: mjwills
Created: 2012-03-01 06:56:21+00:00
State: open

This is more of a question rather than an issue.

If I instantiate a single ElasticClient and use it from multiple threads (without altering ConnectionSettings), should I expect the object to work correctly?

The methods I call from one thread (the 'writer') are:

public bool IsValid { get; }
public ConnectionStatus Index(IEnumerable objects) where T : class;

And from the other (the 'reader') are:

public bool IsValid { get; }
public QueryResponse Search(string search, string index, string typeName) where T : class;

Is this safe, or would I be best to instantiate separate reader and writer clients?