Task cancellation best practices
问题 Lets say I have a processor who's job is to persist files back to the disk. This is running as a Task while observing a BlockingCollection<T> for files to process. When the task gets cancelled and there are still files which should be saved to the disk, what would be a good practice for doing so? It would be convenient to let the task right before exiting quickly write the files remaining back to the disk although I'm not sure if this conflicts with the philosophy of cancelling a task (since