{"action":"created","issue":{"url":"https://api.github.com/repos/swoft-cloud/swoft/issues/239","repository_url":"https://api.github.com/repos/swoft-cloud/swoft","labels_url":"https://api.github.com/repos/swoft-cloud/swoft/issues/239/labels{/name}","comments_url":"https://api.github.com/repos/swoft-cloud/swoft/issues/239/comments","events_url":"https://api.github.com/repos/swoft-cloud/swoft/issues/239/events","html_url":"https://github.com/swoft-cloud/swoft/issues/239","id":321794666,"number":239,"title":"希望可以修改 ConsulProvider 类中的 discoveryTag","user":{"login":"scmforever","id":13246984,"avatar_url":"https://avatars2.githubusercontent.com/u/13246984?v=4","gravatar_id":"","url":"https://api.github.com/users/scmforever","html_url":"https://github.com/scmforever","followers_url":"https://api.github.com/users/scmforever/followers","following_url":"https://api.github.com/users/scmforever/following{/other_user}","gists_url":"https://api.github.com/users/scmforever/gists{/gist_id}","starred_url":"https://api.github.com/users/scmforever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scmforever/subscriptions","organizations_url":"https://api.github.com/users/scmforever/orgs","repos_url":"https://api.github.com/users/scmforever/repos","events_url":"https://api.github.com/users/scmforever/events{/privacy}","received_events_url":"https://api.github.com/users/scmforever/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-10T03:10:29Z","updated_at":"2018-05-10T05:37:16Z","closed_at":null,"author_association":"NONE","body":"| Q                   | A\r\n| ------------------- | -----\r\n| Bug report?         | no\r\n| Feature request?    | yes\r\n| Swoft version       | x.y.z\r\n| Swoole version      | 2.1.1\r\n| PHP version         | 7.1.15\r\n\r\n**Details**\r\n\r\n> 希望 `swoft/Sg/Provider/ConsulProvider` 类可以提供函数对类中的 `$discoveryTag` 进行修改，这样就可以在不同 rpc 服务的连接池中提供不同的 tag，来过滤 consul 返回的 url 列表\r\n\r\n```php\r\nclass BaseServicePool extends ServicePool\r\n{\r\n    /**\r\n     * @var MyConsulProvider\r\n     * @Inject()\r\n     */\r\n    protected $provider;\r\n\r\n    /**\r\n     * @var BasePoolConfig\r\n     */\r\n    protected $poolConfig;\r\n\r\n    protected function getServiceList()\r\n    {\r\n        $name = $this->poolConfig->getName();\r\n        $tag = $this->poolConfig->getTag();\r\n\r\n        return $this->provider->setTag($tag)->getServiceList($name);\r\n    }\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/swoft-cloud/swoft/issues/comments/387957101","html_url":"https://github.com/swoft-cloud/swoft/issues/239#issuecomment-387957101","issue_url":"https://api.github.com/repos/swoft-cloud/swoft/issues/239","id":387957101,"user":{"login":"scmforever","id":13246984,"avatar_url":"https://avatars2.githubusercontent.com/u/13246984?v=4","gravatar_id":"","url":"https://api.github.com/users/scmforever","html_url":"https://github.com/scmforever","followers_url":"https://api.github.com/users/scmforever/followers","following_url":"https://api.github.com/users/scmforever/following{/other_user}","gists_url":"https://api.github.com/users/scmforever/gists{/gist_id}","starred_url":"https://api.github.com/users/scmforever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scmforever/subscriptions","organizations_url":"https://api.github.com/users/scmforever/orgs","repos_url":"https://api.github.com/users/scmforever/repos","events_url":"https://api.github.com/users/scmforever/events{/privacy}","received_events_url":"https://api.github.com/users/scmforever/received_events","type":"User","site_admin":false},"created_at":"2018-05-10T05:37:16Z","updated_at":"2018-05-10T05:37:16Z","author_association":"NONE","body":"![image](https://user-images.githubusercontent.com/13246984/39853845-3e292b00-5457-11e8-9398-58dea5f780a5.png)\r\n"}}
{"actor":{"display_login":"scmforever"}}