Skip to content

Refactor cancellation mechanism and make it internal, accessible via experimental nuget. #2795

Closed

Description

@Ivanidzo4ka

Some time ago I added StopExecution method and IsCancelled flag to IHost.

It was quick solution to make certain algorithms react to stop signal from user. I doubt in long run it's proper way to do it. And it probably required lengthy discussion how to expose stopping functionality (method, or CancellationToken, or something else).

But for now I think it's a good idea to remove method and flag from our public API. Especially considering what no code actually checking IsCancelled flag.

EDIT: We decided to keep this functionality but make it internal and still be accessible via experimental nuget.

Activity

  1. self-assigned this
    on Feb 28, 2019
  2. codemzs commented on Feb 28, 2019

    @codemzs
    Member

    From my experience this kind of work is done via CancellationToken and will be more of a framework design change. You will need to pass that cancellation token from the start till the end or at least through all checkpoints where you would like to stop the execution.

  3. Ivanidzo4ka commented on Feb 28, 2019

    @Ivanidzo4ka
    ContributorAuthor

    As I said above, functionality like this deserve proper discussion, and it's not v1 priority.
    Let's focus right now on code cleaning.

  4. codemzs commented on Feb 28, 2019

    @codemzs
    Member

    @Ivanidzo4ka I wasn't suggesting we do the design work of proper cancellation mechanism now. Anyways PR to clean the cancellation mess is out ...

  5. added this to the 0319 milestone on Mar 18, 2019
  6. changed the title [-]HostEnvironment StopExecution method removal[/-] [+]Refactor cancellation mechanism and make it internal, accessible via experimental nuget.[/+] on Mar 19, 2019
  7. added a commit that references this issue on Mar 3, 2021
  8. added a commit that references this issue on Mar 11, 2021
  9. ghost locked as resolved and limited conversation to collaborators on Mar 24, 2022
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

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions