Skip to content

Thread safety #23

@mjwills

Description

@mjwills

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;

Looking at the NEST code, I think this is safe. Is this safe, or would I be best to instantiate separate reader and writer clients?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions