How to implement Task.WhenAny() with a predicate
<p>I want to execute several asynchronous tasks concurrently. Each task will run an HTTP request that can either complete successfully or throw an exception. I need to <code>await</code> until the first task completes successfully, or until all the tasks have failed.</p>

<p>How can I implement an overload of the <a href="https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task.whenany" rel="nofollow noreferrer"><code>Task.WhenAny</code></a> method that accepts a predicate, so that I can exclude the non-successfully completed tasks?</p>