C# Класс Azi.Tools.Retry

Tool class to retry operations on error
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
DefaultExceptionProcessor ( Exception ex ) : bool
DefaultExceptionProcessorAsync ( Exception ex ) : Task

Описание методов

Do() публичный статический Метод

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.
Результат Task

Do() публичный статический Метод

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
Результат Task

Do() публичный статический Метод

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.
Результат bool

Do() публичный статический Метод

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.
Результат bool

Do() публичный статический Метод

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
Результат bool

Do() публичный статический Метод

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.
Результат bool