[asterisk-scf-commits] asterisk-scf/integration/bridging.git branch "retry_deux" created.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Tue Jan 17 17:26:13 CST 2012
branch "retry_deux" has been created
at c4096313bab94a3de1df64f8838acf36281ddbcc (commit)
- Log -----------------------------------------------------------------
commit c4096313bab94a3de1df64f8838acf36281ddbcc
Author: Ken Hunt <ken.hunt at digium.com>
Date: Tue Jan 17 17:24:50 2012 -0600
Removed redundant retry utility class which already exists in ASTSCFIceUtilCpp.
diff --git a/src/ServiceUtil.h b/src/ServiceUtil.h
index 17f6b1e..cb8470f 100644
--- a/src/ServiceUtil.h
+++ b/src/ServiceUtil.h
@@ -144,51 +144,6 @@ private:
};
//
-// TODO: this should be refactored into a utility library.
-//
-class RetryPolicy
-{
-public:
- //
- // The constructor for those that want to specify intervals in milliseconds.
- //
- RetryPolicy(size_t maxRetries, size_t intervalInMilliseconds) :
- mMaxRetries(maxRetries),
- mRetryInterval(IceUtil::Time::milliSeconds(intervalInMilliseconds)),
- mCounter(0)
- {
- }
-
- //
- // The constructor for those that want to specify intervals in whatever
- // unit they like so long as it is converted to IceUtil::Time.
- //
- RetryPolicy(size_t maxRetries, const IceUtil::Time& interval) :
- mMaxRetries(maxRetries),
- mRetryInterval(interval),
- mCounter(0)
- {
- }
-
- bool canRetry()
- {
- return mCounter < mMaxRetries;
- }
-
- bool retry()
- {
- IceUtil::ThreadControl::sleep(mRetryInterval);
- ++mCounter;
- return canRetry();
- }
-
-private:
- size_t mMaxRetries;
- IceUtil::Time mRetryInterval;
- size_t mCounter;
-};
-
-//
// Helper template to try and create a one way proxy. If the endpoint configuration on the proxy will not allow
// oneways, the original proxy is returned.
//
-----------------------------------------------------------------------
--
asterisk-scf/integration/bridging.git
More information about the asterisk-scf-commits
mailing list