C# Class Azi.Tools.Retry

Tool class to retry operations on error
Datei anzeigen Open project: Rambalac/AmazonCloudDriveApi Class Usage Examples

Public Methods

Method Description
Do ( int times, TimeSpan>.Func retryDelay, Func act ) : Task

Does async func and retries if it failed

Do ( int times, TimeSpan>.Func retryDelay, Func act, Func exceptionPocessor ) : Task

Does async func and retries if it failed

Do ( int times, Func act ) : bool

Does func and retries if it failed

Do ( int times, TimeSpan>.Func retryDelay, Func act ) : bool

Does func and retries if it failed

Do ( int times, TimeSpan>.Func retryDelay, Func act, bool>.Func exceptionPocessor ) : bool

Does func and retries if it failed

Do ( int times, bool>.Func act ) : bool

Does func and retries if it failed

Private Methods

Method Description
DefaultExceptionProcessor ( Exception ex ) : bool
DefaultExceptionProcessorAsync ( Exception ex ) : Task

Method Details

Do() public static method

Does async func and retries if it failed
public static Do ( int times, TimeSpan>.Func retryDelay, Func act ) : Task
times int Maximum times to retry
retryDelay TimeSpan>.Func Func that returns time between each retry. First parameter is number of tries before.
act Func Async Func with action and which returns false if retry required. Throw exception if action fail and can not be retried.
return Task

Do() public static method

Does async func and retries if it failed
public static Do ( int times, TimeSpan>.Func retryDelay, Func act, Func exceptionPocessor ) : Task
times int Maximum times to retry
retryDelay TimeSpan>.Func Func that returns time between each retry. First parameter is number of tries before.
act Func Async Func with action and which returns false if retry required. Throw exception if action fail and can not be retried.
exceptionPocessor Func Async Func that checks exception and return true if action can not be retried
return Task

Do() public static method

Does func and retries if it failed
public static Do ( int times, Func act ) : bool
times int Maximum times to retry
act Func Func with action and which returns false if retry required. Throw exception if action fail and can not be retried.
return bool

Do() public static method

Does func and retries if it failed
public static Do ( int times, TimeSpan>.Func retryDelay, Func act ) : bool
times int Maximum times to retry
retryDelay TimeSpan>.Func Func that returns time between each retry. First parameter is number of tries before.
act Func Func with action and which returns false if retry required. Throw exception if action fail and can not be retried.
return bool

Do() public static method

Does func and retries if it failed
public static Do ( int times, TimeSpan>.Func retryDelay, Func act, bool>.Func exceptionPocessor ) : bool
times int Maximum times to retry
retryDelay TimeSpan>.Func Func that returns time between each retry. First parameter is number of tries before.
act Func Func with action and which returns false if retry required. Throw exception if action fail and can not be retried.
exceptionPocessor bool>.Func Func that checks exception and return true if action can not be retried
return bool

Do() public static method

Does func and retries if it failed
public static Do ( int times, bool>.Func act ) : bool
times int Maximum times to retry
act bool>.Func Func with action and which returns false if retry required. Throw exception if action fail and can not be retried.. Throw exception if action fail and can not be retried. Throw exception if action fail and can not be retried.
return bool