All Classes Namespaces Functions Variables Typedefs Enumerations Friends
python_future_task_collector.h
1 
5 #pragma once
6 
7 #include <mutex>
8 #include <vector>
9 
10 #include <Python.h>
11 
12 namespace ucxx {
13 
14 namespace python {
15 
27  public:
28  std::vector<PyObject*> _toCollect{};
29  std::mutex _mutex{};
30 
37  [[nodiscard]] static PythonFutureTaskCollector& get();
38 
44  void push(PyObject* handle);
45 
56  void collect();
57 
58  private:
65 
66  public:
68  PythonFutureTaskCollector& operator=(PythonFutureTaskCollector const&) = delete;
71 
78 };
79 
80 } // namespace python
81 
82 } // namespace ucxx
A garbage-collector for Python futures.
Definition: python_future_task_collector.h:26
std::mutex _mutex
Mutex to provide safe access to _toCollect.
Definition: python_future_task_collector.h:29
std::vector< PyObject * > _toCollect
Tasks to be collected.
Definition: python_future_task_collector.h:28
static PythonFutureTaskCollector & get()
Definition: address.h:15