Specialized Python implementation of a ucxx::Future.
More...
#include <python_future.h>
|
|
| Future (const Future &)=delete |
|
Future & | operator= (Future const &)=delete |
|
| Future (Future &&o)=delete |
|
Future & | operator= (Future &&o)=delete |
| virtual | ~Future () |
| | Virtual destructor.
|
| void | notify (ucs_status_t status) |
| | Inform the notifier thread that the future has completed.
|
| void | set (ucs_status_t status) |
| | Set the future completion status.
|
| void * | getHandle () |
| | Get the underlying PyObject* handle but does not release ownership.
|
| void * | release () |
| | Get the underlying PyObject* handle and release ownership.
|
|
| Future (const Future &)=delete |
|
Future & | operator= (Future const &)=delete |
|
| Future (Future &&o)=delete |
|
Future & | operator= (Future &&o)=delete |
|
| | Future (std::shared_ptr< Notifier > notifier) |
| | Construct a future that may be notified from a notifier object.
|
|
std::shared_ptr< Notifier > | _notifier {nullptr} |
| | The notifier object.
|
Specialized Python implementation of a ucxx::Future.
Specialized Python implementation of a ucxx::Future, where the future being handled is an instance of asyncio.Future.
◆ ~Future()
| virtual ucxx::python::Future::~Future |
( |
| ) |
|
|
virtual |
Virtual destructor.
Virtual destructor with empty implementation.
Reimplemented from ucxx::Future.
◆ getHandle()
| void * ucxx::python::Future::getHandle |
( |
| ) |
|
|
nodiscardvirtual |
Get the underlying PyObject* handle but does not release ownership.
Get the underlying PyObject* handle without releasing ownership. This can be useful for example for logging, where we want to see the address of the pointer but do not want to transfer ownership.
- Warning
- The destructor will also destroy the Python future, a pointer taken via this method will cause the object to become invalid.
- Exceptions
-
| std::runtime_error | if the object is invalid or has been already released. |
- Returns
- The underlying PyObject* handle.
Implements ucxx::Future.
◆ notify()
| void ucxx::python::Future::notify |
( |
ucs_status_t | status | ) |
|
|
virtual |
Inform the notifier thread that the future has completed.
Inform the notifier thread that the future has completed so it can notify the event loop of that occurrence.
- Exceptions
-
| std::runtime_error | if the object is invalid or has been already released. |
- Parameters
-
| [in] | status | request completion status. |
Implements ucxx::Future.
◆ release()
| void * ucxx::python::Future::release |
( |
| ) |
|
|
nodiscardvirtual |
Get the underlying PyObject* handle and release ownership.
Get the underlying PyObject* handle releasing ownership. This should be used when the future needs to be permanently transferred to Python code. After calling this method the object becomes invalid for any other uses.
- Exceptions
-
| std::runtime_error | if the object is invalid or has been already released. |
- Returns
- The underlying PyObject* handle.
Implements ucxx::Future.
◆ set()
| void ucxx::python::Future::set |
( |
ucs_status_t | status | ) |
|
|
virtual |
Set the future completion status.
Set the future status as completed, either with a successful completion or error.
- Exceptions
-
| std::runtime_error | if the object is invalid or has been already released. |
- Parameters
-
| [in] | status | request completion status. |
Implements ucxx::Future.
◆ createFuture
Constructor of shared_ptr<ucxx::python::Future>.
The constructor for a shared_ptr<ucxx::python::Future> object. The default constructor is made private to ensure all UCXX objects are shared pointers and correct lifetime management.
- Parameters
-
| [in] | notifier | notifier object running on a separate thread. |
- Returns
- The shared_ptr<ucxx::python::Worker> object
◆ createFutureWithEventLoop
Constructor of shared_ptr<ucxx::python::Future>.
The constructor for a shared_ptr<ucxx::python::Future> object. The default constructor is made private to ensure all UCXX objects are shared pointers and correct lifetime management.
- Parameters
-
| [in] | asyncioEventLoop | pointer to a valid Python object containing the event loop that the application is using, to which the future will belong to. |
| [in] | notifier | notifier object running on a separate thread. |
- Returns
- The shared_ptr<ucxx::python::Worker> object
The documentation for this class was generated from the following file: