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
notifier.h
1
5
#pragma once
6
7
#include <condition_variable>
8
#include <memory>
9
#include <mutex>
10
#include <utility>
11
#include <vector>
12
13
#include <ucxx/future.h>
14
#include <ucxx/notifier.h>
15
16
namespace
ucxx
{
17
18
namespace
python {
19
26
class
Notifier :
public
::ucxx::Notifier
{
27
private
:
28
std::mutex _notifierThreadMutex{};
29
std::vector<std::pair<std::shared_ptr<::ucxx::Future>, ucs_status_t>>
30
_notifierThreadFutureStatus{};
31
bool
_notifierThreadFutureStatusReady{
false
};
32
RequestNotifierThreadState
_notifierThreadFutureStatusFinished{
33
RequestNotifierThreadState::NotRunning};
34
std::condition_variable
35
_notifierThreadConditionVariable{};
36
43
Notifier() =
default
;
44
54
[[nodiscard]]
RequestNotifierWaitState
waitRequestNotifierWithoutTimeout();
55
64
[[nodiscard]]
RequestNotifierWaitState
waitRequestNotifierWithTimeout(uint64_t period);
65
66
public
:
67
Notifier(
const
Notifier&) =
delete
;
68
Notifier& operator=(Notifier
const
&) =
delete
;
69
Notifier(Notifier&& o) =
delete
;
70
Notifier& operator=(Notifier&& o) =
delete
;
71
87
friend
std::shared_ptr<::ucxx::Notifier>
createNotifier
();
88
94
virtual
~Notifier
();
95
109
void
scheduleFutureNotify
(std::shared_ptr<::ucxx::Future> future, ucs_status_t status)
override
;
110
123
[[nodiscard]]
RequestNotifierWaitState
waitRequestNotifier
(uint64_t period)
override
;
124
133
void
runRequestNotifier
()
override
;
134
141
void
stopRequestNotifierThread
()
override
;
142
148
[[nodiscard]]
bool
isRunning
()
const override
;
149
};
150
151
}
// namespace python
152
153
}
// namespace ucxx
ucxx::Notifier
Notifier for status of futures.
Definition
notifier.h:38
ucxx::python::Notifier::isRunning
bool isRunning() const override
Returns whether the thread is running.
ucxx::python::Notifier::waitRequestNotifier
RequestNotifierWaitState waitRequestNotifier(uint64_t period) override
Wait for a new event with a timeout in nanoseconds.
ucxx::python::Notifier::createNotifier
friend std::shared_ptr<::ucxx::Notifier > createNotifier()
Constructor of shared_ptr<ucxx::python::Notifier>.
ucxx::python::Notifier::stopRequestNotifierThread
void stopRequestNotifierThread() override
Make known to the notifier thread that it should stop.
ucxx::python::Notifier::runRequestNotifier
void runRequestNotifier() override
Notify event loop of all pending completed Python futures.
ucxx::python::Notifier::~Notifier
virtual ~Notifier()
Virtual destructor.
ucxx::python::Notifier::scheduleFutureNotify
void scheduleFutureNotify(std::shared_ptr<::ucxx::Future > future, ucs_status_t status) override
Schedule event loop notification of completed Python future.
ucxx
Definition
address.h:16
ucxx::RequestNotifierWaitState
RequestNotifierWaitState
The state with which a wait operation completed.
Definition
notifier.h:26
ucxx::RequestNotifierThreadState
RequestNotifierThreadState
The state of the notifier thread.
Definition
notifier.h:19
Generated by
1.18.0