I'm using the AsyncOperation
class to avoid having to write tons of "if (control.InvokeRequired) then/else" methods (as opposed to its traditional role in the Event-Based Asynchronous Pattern). In some cases, I don't really care about getting a notification when the worker thread is complete. Because of this, I'd like to not call the PostOperationCompleted
method on my AsyncOperation
, since it would require me to write a do-nothing callback.
I'm curious whether it's a good idea to omit the call to PostOperationCompleted
. The documentation indicates that it ends the lifetime of the operation and makes further calls invalid, It does not make it clear whether there is internal behavior associated with this call that is vital. It does somewhat hint that there might be internal consequences for omitting the call, but in the end I don't see any strong recommendations to always call it.
So, should I consider it bad practice to omit the call, or is it no big deal?