PythonTask
from panda3d.core import PythonTask
- class PythonTask
Bases:
Bases:
AsyncTask
This class exists to allow association of a Python function or coroutine with the
AsyncTaskManager
.Inheritance diagram
- property __dict__
This is a special variable to hold the instance dictionary in which custom variables may be stored.
getter/setter for PyObject *PythonTask::__dict__;
- __init__(param0: PythonTask)
- property delayTime float
Alias of delay_time.
- Getter
Returns the delay value that has been set via
setDelay()
, if any.Returns the delay value that has been set via
setDelay()
, if any.- Setter
Specifies the amount of time, in seconds, by which this task will be delayed after it has been added to the
AsyncTaskManager
. At least the specified amount of time (and possibly more) will elapse before the task begins.You may specify a delay of 0.0 to guarantee that the task will run in the next epoch following the one in which it is added.
Setting this value after the task has already been added will not affect the task’s wake time; it will only affect the task if it is re-added to the queue in the future, for instance if the task returns DS_again. However, see
recalcWakeTime()
if you wish to apply the delay effect immediately.Specifies the amount of time, in seconds, by which this task will be delayed after it has been added to the
AsyncTaskManager
. At least the specified amount of time (and possibly more) will elapse before the task begins.You may specify a delay of 0.0 to guarantee that the task will run in the next epoch following the one in which it is added.
Setting this value after the task has already been added will not affect the task’s wake time; it will only affect the task if it is re-added to the queue in the future, for instance if the task returns DS_again. However, see
recalcWakeTime()
if you wish to apply the delay effect immediately.
- property delay_time float
The delay value that has been set on this task, if any, or None.
- Getter
Returns the delay value that has been set via
setDelay()
, if any.Returns the delay value that has been set via
setDelay()
, if any.- Setter
Specifies the amount of time, in seconds, by which this task will be delayed after it has been added to the
AsyncTaskManager
. At least the specified amount of time (and possibly more) will elapse before the task begins.You may specify a delay of 0.0 to guarantee that the task will run in the next epoch following the one in which it is added.
Setting this value after the task has already been added will not affect the task’s wake time; it will only affect the task if it is re-added to the queue in the future, for instance if the task returns DS_again. However, see
recalcWakeTime()
if you wish to apply the delay effect immediately.Specifies the amount of time, in seconds, by which this task will be delayed after it has been added to the
AsyncTaskManager
. At least the specified amount of time (and possibly more) will elapse before the task begins.You may specify a delay of 0.0 to guarantee that the task will run in the next epoch following the one in which it is added.
Setting this value after the task has already been added will not affect the task’s wake time; it will only affect the task if it is re-added to the queue in the future, for instance if the task returns DS_again. However, see
recalcWakeTime()
if you wish to apply the delay effect immediately.
- property frame int
The number of frames that have elapsed since the task was started, according to the task manager’s clock.
Returns the number of frames that have elapsed since the task was started, according to the task manager’s clock.
It is only valid to call this if the task’s status is not S_inactive.
- static getClassType() TypeHandle
- getOwner() object
Returns the “owner” object. See
setOwner()
.
- setResult(result: object)
Sets the “result” of this task. This is the value returned from an “await” expression on this task. This can only be called while the task is still alive.
- property time float
The amount of seconds that have elapsed since the task was started, according to the task manager’s clock.
Returns the amount of time that has elapsed since the task was started, according to the task manager’s clock.
It is only valid to call this if the task’s status is not S_inactive.
- property wakeTime float
Alias of wake_time.
If this task has been added to an
AsyncTaskManager
with a delay in effect, this returns the time at which the task is expected to awaken. It has no meaning if the task has not yet been added to a queue, or if there was no delay in effect at the time the task was added.If the task’s status is not S_sleeping, this returns 0.0.
If this task has been added to an
AsyncTaskManager
with a delay in effect, this returns the time at which the task is expected to awaken. It has no meaning if the task has not yet been added to a queue, or if there was no delay in effect at the time the task was added.If the task’s status is not S_sleeping, this returns 0.0.
- property wake_time float
If this task has been added to an
AsyncTaskManager
with a delay in effect, this contains the time at which the task is expected to awaken. It has no meaning of the task has not yet been added to a queue, or if there was no delay in effect at the time the task was added. If the task’s status is not S_sleeping, this contains 0.0.If this task has been added to an
AsyncTaskManager
with a delay in effect, this returns the time at which the task is expected to awaken. It has no meaning if the task has not yet been added to a queue, or if there was no delay in effect at the time the task was added.If the task’s status is not S_sleeping, this returns 0.0.
If this task has been added to an
AsyncTaskManager
with a delay in effect, this returns the time at which the task is expected to awaken. It has no meaning if the task has not yet been added to a queue, or if there was no delay in effect at the time the task was added.If the task’s status is not S_sleeping, this returns 0.0.