| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function register(string $key, Closure $daemon, int $refreshed) : Promised |
||
| 40 | { |
||
| 41 | $this->daemons[$key] = $daemon; |
||
| 42 | |||
| 43 | $refresher = co(function () use ($key) { |
||
| 44 | $this->values[$key] = yield $this->daemons[$key](); |
||
| 45 | }); |
||
| 46 | |||
| 47 | $this->timers[$key] = Timer::loop($refreshed * 1000, $refresher); |
||
| 48 | |||
| 49 | return $refresher(); |
||
| 50 | } |
||
| 85 |