66 EXTENSION(
static PyObject *__await__(PyObject *
self));
67 EXTENSION(
static PyObject *__iter__(PyObject *
self));
69 INLINE
bool done()
const;
70 INLINE
bool cancelled()
const;
71 EXTENSION(PyObject *result(PyObject *timeout = Py_None)
const);
73 virtual bool cancel();
75 INLINE
void set_done_event(
const std::string &done_event);
76 INLINE
const std::string &get_done_event()
const;
77 MAKE_PROPERTY(done_event, get_done_event, set_done_event);
79 EXTENSION(PyObject *add_done_callback(PyObject *
self, PyObject *fn));
81 EXTENSION(
static PyObject *gather(PyObject *args));
83 virtual void output(std::ostream &out)
const;
86 BLOCKING
void wait(
double timeout);
88 EXTENSION(
void set_result(PyObject *));
91 INLINE
void set_result(std::nullptr_t);
104 virtual bool is_task()
const {
return false;}
106 void notify_done(
bool clean_exit);
122 INLINE
bool try_lock_pending();
123 INLINE
void unlock(FutureState new_state = FS_pending);
124 INLINE
bool set_future_state(FutureState state);
129 AtomicAdjust::Integer _future_state;
131 std::string _done_event;
138 friend class PythonTask;
144 static void init_type() {
145 TypedReferenceCount::init_type();
147 TypedReferenceCount::get_class_type());
150 return get_class_type();
152 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
158 INLINE std::ostream &operator << (std::ostream &out,
const AsyncFuture &fut) {
171 virtual bool cancel()
override;
173 INLINE
size_t get_num_futures()
const;
179 AtomicAdjust::Integer _num_pending;
187 static void init_type() {
188 AsyncFuture::init_type();
190 AsyncFuture::get_class_type());
192 virtual TypeHandle get_type()
const override {
193 return get_class_type();
195 virtual TypeHandle force_init_type()
override {init_type();
return get_class_type();}
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class represents a thread-safe handle to a promised future result of an asynchronous operation,...
Specific future that collects the results of several futures.
The AsyncTaskChain is a subset of the AsyncTaskManager.
A class to manage a loose queue of isolated tasks, which can be performed either synchronously (in th...
This class represents a concrete task performed by an AsyncManager.
This class implements a condition variable; see ConditionVar for a brief introduction to this class.
An optional parameter associated with an event.
A base class for all things that want to be reference-counted.
TypeHandle is the identifier used to differentiate C++ class types.
This is an abstract class that all classes which use TypeHandle, and also provide virtual functions t...
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
A base class for things which need to inherit from both TypedWritable and from ReferenceCount.
This is our own Panda specialization on the default STL vector.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.