Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

I want to stop my application when I press Ctrl + c and my code is in below #338

Closed
@divnit

Description

@divnit

public async Task StopAsync(CancellationToken cancellationToken)
{
if (_executingTask == null)
{
return;
}

        _cts.Cancel();

        await Task.WhenAny(_executingTask, Task.Delay(-1, cancellationToken));

        cancellationToken.ThrowIfCancellationRequested();
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions