File indexing completed on 2024-06-23 05:55:45

0001 <?php
0002 /**
0003  * Zend Framework
0004  *
0005  * LICENSE
0006  *
0007  * This source file is subject to the new BSD license that is bundled
0008  * with this package in the file LICENSE.txt.
0009  * It is also available through the world-wide-web at this URL:
0010  * http://framework.zend.com/license/new-bsd
0011  * If you did not receive a copy of the license and are unable to
0012  * obtain it through the world-wide-web, please send an email
0013  * to license@zend.com so we can send you a copy immediately.
0014  *
0015  * @category   Zend
0016  * @package    Zend_Service_WindowsAzure
0017  * @subpackage RetryPolicy
0018  * @version    $Id$
0019  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0020  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0021  */
0022 
0023 /**
0024  * @see Zend_Service_WindowsAzure_RetryPolicy_NoRetry
0025  */
0026 // require_once 'Zend/Service/WindowsAzure/RetryPolicy/NoRetry.php';
0027 
0028 /**
0029  * @see Zend_Service_WindowsAzure_RetryPolicy_RetryN
0030  */
0031 // require_once 'Zend/Service/WindowsAzure/RetryPolicy/RetryN.php';
0032 
0033 /**
0034  * @category   Zend
0035  * @package    Zend_Service_WindowsAzure
0036  * @subpackage RetryPolicy
0037  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0038  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0039  */
0040 abstract class Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract
0041 {
0042     /**
0043      * Execute function under retry policy
0044      * 
0045      * @param string|array $function       Function to execute
0046      * @param array        $parameters     Parameters for function call
0047      * @return mixed
0048      */
0049     public abstract function execute($function, $parameters = array());
0050     
0051     /**
0052      * Create a Zend_Service_WindowsAzure_RetryPolicy_NoRetry instance
0053      * 
0054      * @return Zend_Service_WindowsAzure_RetryPolicy_NoRetry
0055      */
0056     public static function noRetry()
0057     {
0058         return new Zend_Service_WindowsAzure_RetryPolicy_NoRetry();
0059     }
0060     
0061     /**
0062      * Create a Zend_Service_WindowsAzure_RetryPolicy_RetryN instance
0063      * 
0064      * @param int $count                    Number of retries
0065      * @param int $intervalBetweenRetries   Interval between retries (in milliseconds)
0066      * @return Zend_Service_WindowsAzure_RetryPolicy_RetryN
0067      */
0068     public static function retryN($count = 1, $intervalBetweenRetries = 0)
0069     {
0070   return new Zend_Service_WindowsAzure_RetryPolicy_RetryN($count, $intervalBetweenRetries);
0071     }
0072 }