I have the following code that processes an INotification (custom interface)
var mgr = new NotificationManager();
var task = new Task(() => mgr.Send(notification));
task.Start();
Problem is once the Task completes, I need to perform some cleanup on notification. What is the approach for doing this with the Task Parallel library?
You can do this using
ContinueWith. Here is the documentation ContinueWith