Tech Blog

Canceling an Asynchronous Task

By: Chris Dunn on Tue Jan 22, 2019 (8 min read)

When we have a long running operation, it nice to have the option to cancel the operation.  Luckily when they designed the TASK they gave developers the ability to more cleanly exit long running operations.  A TASK is part of the task based asynchronous pattern, which is the suggested pattern moving forward.  With this pattern they have included the idea of a CancellationToken which allows us to signal to a running TASK, that is should cancel. In the following example I've written a simple conso ...

Copyright 2023 Cidean, LLC. All rights reserved.

Proudly running Umbraco 7. This site is responsive with the help of Foundation 5.