@@ -104,20 +104,19 @@ public async Task<string> WaitForResourceAsync(string resourceName, IEnumerable<
104
104
}
105
105
106
106
/// <summary>
107
- /// Waits for a resource to reach one of the specified states. See <see cref="KnownResourceStates"/> for common states .
107
+ /// Waits until a resource satisfies the specified predicate .
108
108
/// </summary>
109
109
/// <remarks>
110
- /// This method returns a task that will complete when the resource reaches one of the specified target states. If the resource
111
- /// is already in the target state, the method will return immediately.<br/>
112
- /// If the resource doesn't reach one of the target states before <paramref name="cancellationToken"/> is signaled, this method
110
+ /// This method returns a task that will complete when the specified predicate returns <see langword="true" />.<br/>
111
+ /// If the predicate isn't satisfied before <paramref name="cancellationToken"/> is signaled, this method
113
112
/// will throw <see cref="OperationCanceledException"/>.
114
113
/// </remarks>
115
114
/// <param name="resourceName">The name of the resource.</param>
116
115
/// <param name="predicate">A predicate which is evaluated for each <see cref="ResourceEvent"/> for the selected resource.</param>
117
116
/// <param name="cancellationToken">A cancellation token that cancels the wait operation when signaled.</param>
118
117
/// <returns>A <see cref="Task{ResourceEvent}"/> representing the wait operation and which of the target states the resource reached.</returns>
119
118
[ System . Diagnostics . CodeAnalysis . SuppressMessage ( "ApiDesign" , "RS0026:Do not add multiple public overloads with optional parameters" ,
120
- Justification = "targetState(s) parameters are mutually exclusive." ) ]
119
+ Justification = "predicate and targetState(s) parameters are mutually exclusive." ) ]
121
120
public async Task < ResourceEvent > WaitForResourceAsync ( string resourceName , Func < ResourceEvent , bool > predicate , CancellationToken cancellationToken = default )
122
121
{
123
122
using var watchCts = CancellationTokenSource . CreateLinkedTokenSource ( _applicationStopping , cancellationToken ) ;
0 commit comments