Why does Task<T>
not have a OnExit
event that is invoked upon exiting through Exception or finishing regularly.
If I have an operation, for which I dont know when it will finish and whose result my continuing code does not depend on, I wont want to await it.
If im interested in the result however, whenever it may occur, I would have to await Task<T>
.
Am I missing something here and such behaviour is already natively possible?
Naive delegate type of OnExit
in my head would be something like this
delegate void TaskExitHandler<T>(T result, Exception exception)
.