From events and callbacks to Tasks with TaskCompletionSource
Event-based and callback APIs scatter one operation across three methods and a flag. TaskCompletionSource turns them into a single awaitable call. Here's how to wrap them correctly, with unsubscription, cancellation, timeouts and request correlation.