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

error

Exception raised during task, if any

is_active

Whether the task is currently active

is_cancelled

Check if the task was cancelled.

is_error

Check if the task encountered an error.

is_finished

Check if the task has finished successfully.

is_running

Check if the task is currently running.

message

Status message for the task

progress

Progress of the task, from 0.0 to 1.0

result

Result of the task execution

state

Current state of the task

Methods

__init__

Initialize the GEETask with an event loop, coroutine function, and optional key and final callback.

cancel

Cancel the running task.

start

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)

GEETask.cancel()[source]#

Cancel the running task.

Return type:

None

GEETask.start(*args, **kwargs)[source]#

Schedule the wrapped coroutine on the provided loop.

Return type:

Future