Skip to main content Skip to complementary content
Close announcements banner

RetryOnAbort Method

Overloads

RetryOnAbort<T>(Func<Task<T>>, Int32, Int32)

Perform the request and retry if the operation is aborted due to a generic abort.

RetryOnAbort<T>(Func<Task<T>>, Int32, Int32)

Perform the request and retry if the operation is aborted due to a generic abort.

Declaration

      public Task<T> RetryOnAbort<T>(Func<Task<T>> requestAsync, int attempts = 3, int delayMs = 50)
    

Parameters

Type Name Description
System.Func<System.Threading.Tasks.Task<T>> requestAsync

The request to perform.

System.Int32 attempts

Maximum number of attempts before giving up.

System.Int32 delayMs

Delay between attempts (in milliseconds).

Returns

Type Description
System.Threading.Tasks.Task<T>

The value returned by the request.

Type Parameters

Name Description
T

The return type of the operation.

Implements

Examples

GenericObject o = myObject; var layout = o.Session.RetryOnAbort(o.GetLayoutAsync);

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!