pysepal.scripts.gee_task.GEETask#
- class pysepal.scripts.gee_task.GEETask(*args, **kwargs)[source]#
Wrap an async coroutine in an observable, cancellable task with a final callback.
Initialize the GEETask with an event loop, coroutine function, and optional key and final callback.
Attributes
errorException raised during task, if any
is_activeWhether the task is currently active
is_cancelledCheck if the task was cancelled.
is_errorCheck if the task encountered an error.
is_finishedCheck if the task has finished successfully.
is_runningCheck if the task is currently running.
messageStatus message for the task
progressProgress of the task, from 0.0 to 1.0
resultResult of the task execution
stateCurrent state of the task
Methods
Initialize the GEETask with an event loop, coroutine function, and optional key and final callback.
Cancel the running task.
Schedule the wrapped coroutine on the provided loop.
- Parameters:
loop (AbstractEventLoop)
function (Callable[[...], Coroutine[Any, Any, R]])
key (str | None)
on_finally (Callable[[], None] | None)
- GEETask.__init__(loop, function, key=None, on_finally=None)[source]#
Initialize the GEETask with an event loop, coroutine function, and optional key and final callback.
- Parameters:
loop (AbstractEventLoop)
function (Callable[[...], Coroutine[Any, Any, R]])
key (str | None)
on_finally (Callable[[], None] | None)