@@ -47,7 +47,7 @@ |
||
| 47 | 47 | $this->routing ?? |
| 48 | 48 | $this->routing = (new Routing( |
| 49 | 49 | sprintf('%s:%s', $this->type, $this->server), |
| 50 | - function (int $evk, Endpoint $endpoint) { |
|
| 50 | + function(int $evk, Endpoint $endpoint) { |
|
| 51 | 51 | $this->changed($evk, $endpoint); |
| 52 | 52 | } |
| 53 | 53 | ))->strictly($this->strict)->accepts(...$this->tags) |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | { |
| 92 | 92 | if (!$this->strict || $this->inTags($endpoint->getTags())) { |
| 93 | 93 | $this->selector->classify($endpoint); |
| 94 | - logger('cluster')->info('Discovered new service', ['node' => (string)$endpoint]); |
|
| 94 | + logger('cluster')->info('Discovered new service', ['node' => (string) $endpoint]); |
|
| 95 | 95 | ($this->watcher)(self::JOINING, $endpoint); |
| 96 | 96 | } else { |
| 97 | 97 | $this->nmWarning($endpoint, 'route.join'); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | { |
| 106 | 106 | if (!$this->strict || $this->inTags($endpoint->getTags())) { |
| 107 | 107 | $this->selector->release($endpoint); |
| 108 | - logger('cluster')->info('Service is gone', ['node' => (string)$endpoint]); |
|
| 108 | + logger('cluster')->info('Service is gone', ['node' => (string) $endpoint]); |
|
| 109 | 109 | ($this->watcher)(self::LEAVING, $endpoint); |
| 110 | 110 | } else { |
| 111 | 111 | $this->nmWarning($endpoint, 'route.leave'); |
@@ -26,11 +26,11 @@ |
||
| 26 | 26 | { |
| 27 | 27 | $oid = spl_object_id($managed); |
| 28 | 28 | |
| 29 | - $this->checker[$oid] = Timer::loop(30000, function () use ($sk) { |
|
| 29 | + $this->checker[$oid] = Timer::loop(30000, function() use ($sk) { |
|
| 30 | 30 | logger('cluster')->notice('Now is waiting', ['resource' => $sk]); |
| 31 | 31 | }); |
| 32 | 32 | |
| 33 | - $managed->joined(function () use ($oid) { |
|
| 33 | + $managed->joined(function() use ($oid) { |
|
| 34 | 34 | Timer::clear($this->checker[$oid]); |
| 35 | 35 | }); |
| 36 | 36 | } |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | |
| 85 | 85 | $this->waits[$sk] = $wait = $this->classify->discovery($scene)->attach($group, $server, $managed); |
| 86 | 86 | |
| 87 | - $wait->then(function () use ($sk) { |
|
| 87 | + $wait->then(function() use ($sk) { |
|
| 88 | 88 | unset($this->waits[$sk]); |
| 89 | 89 | }); |
| 90 | 90 | |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | |
| 51 | 51 | $this->managed[$named = $this->named($group, $server)] = $managed; |
| 52 | 52 | |
| 53 | - $this->source->watching($named, static function (string $dsn = null) use ($table, $named, $managed) { |
|
| 53 | + $this->source->watching($named, static function(string $dsn = null) use ($table, $named, $managed) { |
|
| 54 | 54 | foreach ($table->reset(...self::endpoints($dsn ?? '', $named)) as $op) { |
| 55 | 55 | $op->joined() && $managed->routing()->join($op->target()); |
| 56 | 56 | $op->leaved() && $managed->routing()->leave($op->target()); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | { |
| 50 | 50 | $this->managed[$domain = $this->domain($server)] = $managed; |
| 51 | 51 | |
| 52 | - go(static function () use ($domain, $managed) { |
|
| 52 | + go(static function() use ($domain, $managed) { |
|
| 53 | 53 | try { |
| 54 | 54 | /** |
| 55 | 55 | * @var Result $resolved |
@@ -86,6 +86,6 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | private function domain(string $server) : string |
| 88 | 88 | { |
| 89 | - return $server . $this->suffix; |
|
| 89 | + return $server.$this->suffix; |
|
| 90 | 90 | } |
| 91 | 91 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | ) |
| 62 | 62 | ; |
| 63 | 63 | |
| 64 | - new Worker($notify, function (array $routes) use ($named, $managed) { |
|
| 64 | + new Worker($notify, function(array $routes) use ($named, $managed) { |
|
| 65 | 65 | /** |
| 66 | 66 | * @var Router[] $routes |
| 67 | 67 | */ |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $managed->ready(true); |
| 78 | 78 | }); |
| 79 | 79 | |
| 80 | - return $managed->ready(function () use ($named, $managed) { |
|
| 80 | + return $managed->ready(function() use ($named, $managed) { |
|
| 81 | 81 | $this->instances[$named] = $managed; |
| 82 | 82 | }); |
| 83 | 83 | } |