Multithreading

There are a few things you should consider before using python-arango in a multithreaded (or multiprocess) architecture.

Stateful Objects

Instances of the following classes are considered stateful, and should not be accessed across multiple threads without locks in place:

HTTP Sessions

When ArangoClient is initialized, a requests.Session instance is created per ArangoDB host connected. HTTP requests to a host are sent using only its corresponding session. For more information on how to override this behaviour, see HTTP Clients.

Note that a requests.Session object may not always be thread-safe. Always research your use case!