Home
libucxx
libucxx
ucxx
nightly (0.53)
nightly (0.53)
stable (0.52)
legacy (0.51)
Toggle main menu visibility
Loading...
Searching...
No Matches
python
include
ucxx
python
python_future.h
1
5
#pragma once
6
7
#include <functional>
8
#include <memory>
9
10
#include <Python.h>
11
12
#include <ucp/api/ucp.h>
13
14
#include <ucxx/future.h>
15
#include <ucxx/notifier.h>
16
#include <ucxx/python/future.h>
17
18
namespace
ucxx
{
19
20
namespace
python {
21
28
class
Future :
public
::ucxx::Future
{
29
private
:
30
PyObject* _asyncioEventLoop{
nullptr
};
31
PyObject* _handle{
nullptr
};
32
47
explicit
Future(PyObject* asyncioEventLoop, std::shared_ptr<::ucxx::Notifier> notifier);
48
49
public
:
50
Future() =
delete
;
51
Future(
const
Future&) =
delete
;
52
Future& operator=(Future
const
&) =
delete
;
53
Future(Future&& o) =
delete
;
54
Future& operator=(Future&& o) =
delete
;
55
67
friend
std::shared_ptr<::ucxx::Future>
createFuture
(std::shared_ptr<::ucxx::Notifier> notifier);
68
83
friend
std::shared_ptr<::ucxx::Future>
createFutureWithEventLoop
(
84
PyObject* asyncioEventLoop, std::shared_ptr<::ucxx::Notifier> notifier);
85
91
virtual
~Future
();
92
103
void
notify
(ucs_status_t status);
104
114
void
set
(ucs_status_t status);
115
130
[[nodiscard]]
void
*
getHandle
();
131
143
[[nodiscard]]
void
*
release
();
144
};
145
146
}
// namespace python
147
148
}
// namespace ucxx
ucxx::Future
Represent a future that may be notified by a specialized notifier.
Definition
future.h:21
ucxx::python::Future::createFutureWithEventLoop
friend std::shared_ptr<::ucxx::Future > createFutureWithEventLoop(PyObject *asyncioEventLoop, std::shared_ptr<::ucxx::Notifier > notifier)
Constructor of shared_ptr<ucxx::python::Future>.
ucxx::python::Future::~Future
virtual ~Future()
Virtual destructor.
ucxx::python::Future::set
void set(ucs_status_t status)
Set the future completion status.
ucxx::python::Future::notify
void notify(ucs_status_t status)
Inform the notifier thread that the future has completed.
ucxx::python::Future::release
void * release()
Get the underlying PyObject* handle and release ownership.
ucxx::python::Future::getHandle
void * getHandle()
Get the underlying PyObject* handle but does not release ownership.
ucxx::python::Future::createFuture
friend std::shared_ptr<::ucxx::Future > createFuture(std::shared_ptr<::ucxx::Notifier > notifier)
Constructor of shared_ptr<ucxx::python::Future>.
ucxx
Definition
address.h:16
Generated by
1.18.0