File: backoff.h

package info (click to toggle)
php-redis 5.3.7%2B4.3.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,012 kB
  • sloc: ansic: 34,345; php: 12,275; xml: 1,910; sh: 297; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 665 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef REDIS_BACKOFF_H
#define REDIS_BACKOFF_H

/* {{{ struct RedisBackoff */
struct RedisBackoff {
    unsigned int algorithm;        /* index of algorithm function, returns backoff in microseconds*/
    zend_ulong   base;             /* base backoff in microseconds */
    zend_ulong   cap;              /* max backoff in microseconds */
    zend_ulong   previous_backoff; /* previous backoff in microseconds */
};
/* }}} */

void redis_initialize_backoff(struct RedisBackoff *self, unsigned long retry_interval);
void redis_backoff_reset(struct RedisBackoff *self);
zend_ulong redis_backoff_compute(struct RedisBackoff *self, unsigned int retry_index);

#endif