Skip to content

Task progress meters #88

@chrisguidry

Description

@chrisguidry

As an extension to the timeout idea in #87, a similar interface could be used to express intermediate progress (visible on the snapshot or programmatically):

async def long_running(
    progress: Progress = Progress()
) -> None:
    batch = get_some_work()
    progress.set_total(len(batch))
    for item in batch:
        do_some_work(item)
        progress.increment()  # 1 by default, but could be other values

This could be asynchronously incrementing an ephemeral redis key to show progress for this specific task.

Metadata

Metadata

Assignees

Labels

devxMakes Docket the most ergonomic background task systemenhancementMakes Docket better

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions