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 INLINE
void set_result(std::nullptr_t);
103 virtual bool is_task()
const {
return false;}
105 void notify_done(
bool clean_exit);
121 INLINE
bool try_lock_pending();
122 INLINE
void unlock(FutureState new_state = FS_pending);
123 INLINE
bool set_future_state(FutureState state);
128 AtomicAdjust::Integer _future_state;
130 std::string _done_event;
137 friend class PythonTask;
143 static void init_type() {
144 TypedReferenceCount::init_type();
146 TypedReferenceCount::get_class_type());
149 return get_class_type();
151 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
157 INLINE std::ostream &operator << (std::ostream &out,
const AsyncFuture &fut) {
170 virtual bool cancel()
override;
172 INLINE
size_t get_num_futures()
const;
178 AtomicAdjust::Integer _num_pending;
186 static void init_type() {
187 AsyncFuture::init_type();
189 AsyncFuture::get_class_type());
191 virtual TypeHandle get_type()
const override {
192 return get_class_type();
194 virtual TypeHandle force_init_type()
override {init_type();
return get_class_type();}
This class represents a thread-safe handle to a promised future result of an asynchronous operation,...
An optional parameter associated with an event.
A class to manage a loose queue of isolated tasks, which can be performed either synchronously (in th...
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.
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
This is an abstract class that all classes which use TypeHandle, and also provide virtual functions t...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypedObject * get_result() const
Returns this future's result.
This is our own Panda specialization on the default STL vector.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
The AsyncTaskChain is a subset of the AsyncTaskManager.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for things which need to inherit from both TypedWritable and from ReferenceCount.
Specific future that collects the results of several futures.
A base class for all things that want to be reference-counted.
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.
TypeHandle is the identifier used to differentiate C++ class types.
virtual bool cancel()
Cancels the future.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.