Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup ThreadPool with atexit rather than __del__
This removes the __del__ function from the generated Python client, and replaces it with a cleanup function. When a ThreadPool is created, the cleanup function is registered with the atexit module. This PR also allows the client to be used as a context manager, which will automatically clean up after itself rather than having to wait til process exit. This fixes #1037, where the API client could hang indefinitely at garbage collection.
- Loading branch information