pysepal.solara.notifications.notifier.TaskTracker#

class pysepal.solara.notifications.notifier.TaskTracker(bus, task)[source]#

Context manager for tracking a long-running task with milestones.

Initialize tracker with a bus reference and task identity.

Methods

__init__

Initialize tracker with a bus reference and task identity.

cancel

Explicitly mark the task as cancelled.

complete

Explicitly mark the task as completed.

fail

Explicitly mark the task as failed.

set_progress

Update continuous progress (0.0-1.0).

step

Add a named milestone and increment current_step.

update

Update the task title.

Parameters:
TaskTracker.__init__(bus, task)[source]#

Initialize tracker with a bus reference and task identity.

Parameters:
TaskTracker.cancel()[source]#

Explicitly mark the task as cancelled.

Return type:

None

TaskTracker.complete(message=None)[source]#

Explicitly mark the task as completed.

Parameters:

message (str | None)

Return type:

None

TaskTracker.fail(message)[source]#

Explicitly mark the task as failed.

Parameters:

message (str)

Return type:

None

TaskTracker.set_progress(value)[source]#

Update continuous progress (0.0-1.0). Does NOT create a milestone.

Parameters:

value (float)

Return type:

None

TaskTracker.step(message)[source]#

Add a named milestone and increment current_step.

Parameters:

message (str)

Return type:

None

TaskTracker.update(title)[source]#

Update the task title.

Parameters:

title (str)

Return type:

None