hyperf/jet

希望增加对 consul 支持

Closed this issue · 2 comments

    $node = with(
            (new Catalog(function () {
                return new Client(['base_uri' => 'http://192.168.1.1:8500']);
            }))
                ->service('CalculatorService')
                ->json(),
            function ($nodes) {
                $rand = array_rand($nodes, 1);
                $node = $nodes[$rand];

                return [
                    'host' => Arr::get($node, 'Address'),
                    'port' => Arr::get($node, 'ServicePort'),
                ];
            });

        return $node;

欢迎 PR

欢迎 PR

已提交