This repository has been archived by the owner on Feb 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dariusz Lenartowicz
committed
Oct 21, 2016
1 parent
79c11a0
commit 04fecb7
Showing
6 changed files
with
94 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
|
||
namespace Ses.Subscriptions | ||
{ | ||
internal class FetchAttemptsThresholdException : Exception | ||
{ | ||
public string PoolerType { get; private set; } | ||
public int ExecuteRetryAttempts { get; private set; } | ||
|
||
public FetchAttemptsThresholdException(string poolerType, int executeRetryAttempts, Exception exception) | ||
: base($"Pooler {poolerType} excides retries attempts threshold.", exception) | ||
{ | ||
PoolerType = poolerType; | ||
ExecuteRetryAttempts = executeRetryAttempts; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace Ses.Subscriptions | ||
{ | ||
public class PoolerRetriesPolicy | ||
{ | ||
public int HandlerAttemptsThreshold { get; private set; } | ||
public int FetchAttemptsThreshold { get; private set; } | ||
|
||
public PoolerRetriesPolicy(int fetchAttemptsThreshold, int handlerAttemptsThreshold) | ||
{ | ||
if (fetchAttemptsThreshold < 0) fetchAttemptsThreshold = 0; | ||
if (handlerAttemptsThreshold < 0) handlerAttemptsThreshold = 0; | ||
FetchAttemptsThreshold = fetchAttemptsThreshold; | ||
HandlerAttemptsThreshold = handlerAttemptsThreshold; | ||
} | ||
|
||
public static PoolerRetriesPolicy Defaut() | ||
{ | ||
return new PoolerRetriesPolicy(3, 3); | ||
} | ||
|
||
public static PoolerRetriesPolicy NoRetries() | ||
{ | ||
return new PoolerRetriesPolicy(0, 0); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters