* This can be used to get handle wrappers that free the handle when the wrapper
* leaves scope. The maximum number of free handles (connections) is configurable.
* This provides an easy way to cache connection handles that may also have state,
- * such as handle does between multi() and exec(), and without hoarding connections.
+ * such as a handle does between multi() and exec(), and without hoarding connections.
* The wrappers use PHP magic methods so that calling functions on them calls the
* function of the actual Redis object handle.
*
* @return RedisConnectionPool
*/
public static function singleton( array $options ) {
+ ksort( $options ); // normalize
$id = sha1( serialize( $options ) );
if ( !isset( self::$instances[$id] ) ) {
self::$instances[$id] = new self( $options );
const ROOTJOB_TTL = 1209600; // integer; seconds to remember root jobs (14 days)
const MAX_AGE_PRUNE = 604800; // integer; seconds a job can live once claimed (7 days)
- const MAX_ATTEMPTS = 3; // integer; number of times to try a job
/**
* @params include:
$conn = $this->getConnection();
try {
- // Find which of these jobs are duplicates unclaimed jobs in the queue...
+ // Find which of these jobs are duplicates of unclaimed jobs in the queue...
if ( count( $dedupUids ) ) {
$conn->multi( Redis::PIPELINE );
foreach ( $dedupUids as $uid ) { // check if job data exists