Skip to content

OWEwoksWidgetWithTaskStack: provide API to cancel a task #387

Closed

Description

@payno

Today OWEwoksWidgetWithTaskStack doesn't provide API to cancel a task.

There is two approaches:

  • simple: allow to cancel the current task and the clear all task
  • advanced but more powerful: allow to cancel a specific task (like using an id)

Activity

  1. self-assigned this
    on Jun 1, 2026
  2. linked a pull request that will close this issueewoksOrange task processing: move to Future. #390on Jun 1, 2026
  3. payno commented on Jun 5, 2026

    @payno
    MemberAuthor

    This was discussed during the ewoks meeting.
    Decision was to go to provide future & associated API.

    • OWWidgetBase.execute_task() -> OWFuture
    • OWFuture.cancel_or_abort(): bool
    • In case of "nothread": the OWFuture.cancel_or_abort() always returns False
  4. payno commented on Oct 6, 2026

    @payno
    MemberAuthor

    For me this part is mostly done. The TaskFuture is a concurrent.futures.Future, and we now are using futures Executor.
    So those can be cancelled if not running already.

    Then on ewoks side we provide an API to abort those. At the TaskFuture the API is called abort but at ewoks core side it is calling the Task.cancel API. Which is misleading in the name.

    It also let the user the role to define how his task should be aborted. That at the time I am still good in the idea because I think it can vary a lot from one use case to the other. It also let us space to determine 'standard' behavior in the future.

    I would be in favor to rename ewokscore task.cancel to task.abort and deprecate it in the next ewoks 6.0 version.

  5. updated priority high and progress in-progress on Oct 6, 2026
  6. linked a pull request that will close this issueAdapt to Task.cancel now being deprecated. #490on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

priority

high

progress

in-progress

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions