You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// <summary>Returns <paramrefname="source"/> if it is not faulted, otherwise evaluates <paramrefname="fallbackThunk"/> and returns the result.</summary>
428
+
///
429
+
/// <paramname="fallbackThunk">A thunk that provides an alternate task computation when evaluated.</param>
430
+
/// <paramname="source">The input task.</param>
431
+
///
432
+
/// <returns>The task if it is not faulted, else the result of evaluating <paramrefname="fallbackThunk"/>.</returns>
433
+
/// <remarks><paramrefname="fallbackThunk"/> is not evaluated unless <paramrefname="source"/> is faulted.</remarks>
434
+
///
435
+
let inlineorElseWith([<InlineIfLambda>]fallbackThunk:exn ->Task<'T>)(source:Task<'T>):Task<'T>=
436
+
letsource= nullArgCheck (nameof source) source
437
+
tryWith (fun()-> source) fallbackThunk
438
+
439
+
/// <summary>Returns <paramrefname="source"/> if it is not faulted, otherwise e<paramrefname="fallbackTask"/>.</summary>
440
+
///
441
+
/// <paramname="fallbackTask">The alternative Task to use if <paramrefname="source"/> is faulted.</param>
442
+
/// <paramname="source">The input task.</param>
443
+
///
444
+
/// <returns>The option if the option is Some, else the alternate option.</returns>
/// <summary>Returns <paramrefname="source"/> if it is not faulted, otherwise evaluates <paramrefname="fallbackThunk"/> and returns the result.</summary>
299
+
///
300
+
/// <paramname="fallbackThunk">A thunk that provides an alternate task computation when evaluated.</param>
301
+
/// <paramname="source">The input task.</param>
302
+
///
303
+
/// <returns>The task if it is not faulted, else the result of evaluating <paramrefname="fallbackThunk"/>.</returns>
304
+
/// <remarks><paramrefname="fallbackThunk"/> is not evaluated unless <paramrefname="source"/> is faulted.</remarks>
305
+
///
306
+
let inlineorElseWith([<InlineIfLambda>]fallbackThunk:exn ->ValueTask<'T>)(source:ValueTask<'T>):ValueTask<'T>= tryWith fallbackThunk (fun()-> source)
307
+
308
+
/// <summary>Returns <paramrefname="source"/> if it is not faulted, otherwise e<paramrefname="fallbackValueTask"/>.</summary>
309
+
///
310
+
/// <paramname="fallbackValueTask">The alternative ValueTask to use if <paramrefname="source"/> is faulted.</param>
311
+
/// <paramname="source">The input task.</param>
312
+
///
313
+
/// <returns>The option if the option is Some, else the alternate option.</returns>
0 commit comments