<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ## Mix Micro 與 go-micro 生態深度集成的 php 微服務開發框架,可獨立使用 ## 組件 使用 [composer]([https://www.phpcomposer.com/](https://www.phpcomposer.com/)) 安裝: ``` composer require mix/micro ``` ## 概述 支持的服務器 - [Mix gRPC](https://github.com/mix-php/grpc) - [Mix JSON-RPC](https://github.com/mix-php/json-rpc) - [Mix Http Server](https://github.com/mix-php/http-server) 支持的注冊中心、配置中心 - [Mix Micro Etcd](https://github.com/mix-php/micro-etcd) 其他微服務治理組件 - [Mix Micro Hystrix](https://github.com/mix-php/micro-hystrix) `需單獨安裝` - [Mix Tracing Zipkin](https://github.com/mix-php/tracing-zipkin) `需單獨安裝` ## 使用 ### 創建一個 gRPC 服務器 詳細使用請查看 “gRPC” 章節: ```php $server = new \Mix\Grpc\Server('0.0.0.0'); // 默認會隨機分配端口,也可以指定 $server->register(SayService::class); ``` ### 創建一個注冊中心 詳細使用請查看 “服務注冊” 章節: ```php $registry = new \Mix\Micro\Etcd\Registry('http://127.0.0.1:2379/v3'); ``` ### 創建一個配置中心 詳細使用請查看 “配置中心” 章節: ```php $config = new \Mix\Micro\Etcd\Config('http://127.0.0.1:2379/v3'); $config->listen($eventDispatcher); // PSR-14 Event Dispatcher ``` ### 執行一個微服務 啟動后會自動監聽 SIGINT, SIGTERM, SIGQUIT 信號,自動優雅停止,如果想自己處理信號,傳入 `Micro::signal(false)` 配置 ```php use Mix\Micro\Micro; Micro::service( Micro::server($server), Micro::registry($registry), Micro::config($config), Micro::logger($logger), // PSR-3 Logger Micro::version('latest'), Micro::metadata(['foo' => 'bar']) )->run(); ``` 執行后日志打印: ```php [2020-05-21 21:01:18] API.INFO: Server started [0.0.0.0:51438] [2020-05-21 21:01:18] API.INFO: Register service [php.micro.grpc.greeter-2938109e-9b63-11ea-80bd-000057bdb82e] ``` 啟動后的微服務可使用 [Micro](https://micro.mu/docs/runtime.html) 工具包 API Gateway、Web Dashboard、Web Proxy 等多種微服務管理工具,也可在 PHP 代碼中使用 [Mix gRPC](https://github.com/mix-php/grpc) 的 Client 直接調用 [go-micro](https://github.com/micro/go-micro) 編寫的微服務。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看