| 1 | <?php |
||
| 12 | class RedisTicker extends Component |
||
| 13 | { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var \yii\redis\Connection |
||
| 17 | */ |
||
| 18 | public $redis; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Init. |
||
| 22 | * |
||
| 23 | * @throws \yii\base\InvalidConfigException |
||
| 24 | */ |
||
| 25 | public function init() |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Acquires tick by given name. |
||
| 34 | * |
||
| 35 | * @param string $name of the tick to be acquired. |
||
| 36 | * @param integer $timeout to wait for tick to become released. |
||
| 37 | * |
||
| 38 | * @return boolean tick result. |
||
| 39 | */ |
||
| 40 | public function tick($name, $timeout = 1) |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return \yii\redis\Connection |
||
| 63 | */ |
||
| 64 | protected function getConnection() |
||
| 68 | } |
||
| 69 |