This gem is not thread safe. This because of the way queries are built and executed.
If between the time you build a query and the time you execute said query another thread starts building a query. The new one overwrites the first one.
Here's an example.
There is a shared instance of OData::Service
Thread A starts building a query.
Thread B is given CPU time.
Thread B builds a query.
Thread B executes the last query.
Query B gets executed.
Thread A regains control.
Thread A executes the last query.
Query B gets executed.
In this example, the first query (A) never gets executed and the second query (B) gets executed twice.
This gem is not thread safe. This because of the way queries are built and executed.
If between the time you build a query and the time you execute said query another thread starts building a query. The new one overwrites the first one.
Here's an example.
There is a shared instance of OData::Service Thread A starts building a query. Thread B is given CPU time. Thread B builds a query. Thread B executes the last query. Query B gets executed. Thread A regains control. Thread A executes the last query. Query B gets executed.
In this example, the first query (A) never gets executed and the second query (B) gets executed twice.