{"action":"closed","number":27,"pull_request":{"url":"https://api.github.com/repos/eleme/gunicorn_thrift/pulls/27","id":68347099,"html_url":"https://github.com/eleme/gunicorn_thrift/pull/27","diff_url":"https://github.com/eleme/gunicorn_thrift/pull/27.diff","patch_url":"https://github.com/eleme/gunicorn_thrift/pull/27.patch","issue_url":"https://api.github.com/repos/eleme/gunicorn_thrift/issues/27","number":27,"state":"closed","locked":false,"title":"Add register cls and zookeeper register method","user":{"login":"wangyibo360","id":11389730,"avatar_url":"https://avatars.githubusercontent.com/u/11389730?v=3","gravatar_id":"","url":"https://api.github.com/users/wangyibo360","html_url":"https://github.com/wangyibo360","followers_url":"https://api.github.com/users/wangyibo360/followers","following_url":"https://api.github.com/users/wangyibo360/following{/other_user}","gists_url":"https://api.github.com/users/wangyibo360/gists{/gist_id}","starred_url":"https://api.github.com/users/wangyibo360/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wangyibo360/subscriptions","organizations_url":"https://api.github.com/users/wangyibo360/orgs","repos_url":"https://api.github.com/users/wangyibo360/repos","events_url":"https://api.github.com/users/wangyibo360/events{/privacy}","received_events_url":"https://api.github.com/users/wangyibo360/received_events","type":"User","site_admin":false},"body":"@wooparadog \r\n你好，求review一下代码，\r\n主要内容就是根据ServiceRegisterClass和ServiceRegisterConf，自己写了一个注册的基类Register，然后实现了向zookeeper注册的功能代码。\r\n新重写了ThriftOnExit配置类，其实覆盖了原有的OnExit类，在on_exit方法中加进去了删除注册地址的动作。因为我看gunicorn源码里面的清理动作都是在halt里面进行的，halt最后调用on_exit进行退出前的行为。也可以不加入这部分代码，我们在zookeeper注册的节点都是临时的，程序退出时会自动清理，但是会有时间延迟，不主动清理的话怕会对thrift客户端产生影响。\r\n\r\n有些问题需要讨论一下：\r\n目前的注册机制是在application.run()之前，这样会不会有问题，如果run没有起来，但是已经发生注册了，这样thrift客户端有可能获取到一个未成功运行的端口。\r\n为什么不在config里面的when_ready去执行注册的动作呢？\r\n","created_at":"2016-04-29T09:47:02Z","updated_at":"2016-05-07T02:37:46Z","closed_at":"2016-05-07T02:37:46Z","merged_at":null,"merge_commit_sha":"470ba181c25ede5c09a0c731c482ae74492e1b1d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/eleme/gunicorn_thrift/pulls/27/commits","review_comments_url":"https://api.github.com/repos/eleme/gunicorn_thrift/pulls/27/comments","review_comment_url":"https://api.github.com/repos/eleme/gunicorn_thrift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eleme/gunicorn_thrift/issues/27/comments","statuses_url":"https://api.github.com/repos/eleme/gunicorn_thrift/statuses/c5c3166573de2f4013ad52b80d81d90e9cba6675","head":{"label":"wangyibo360:master","ref":"master","sha":"c5c3166573de2f4013ad52b80d81d90e9cba6675","user":{"login":"wangyibo360","id":11389730,"avatar_url":"https://avatars.githubusercontent.com/u/11389730?v=3","gravatar_id":"","url":"https://api.github.com/users/wangyibo360","html_url":"https://github.com/wangyibo360","followers_url":"https://api.github.com/users/wangyibo360/followers","following_url":"https://api.github.com/users/wangyibo360/following{/other_user}","gists_url":"https://api.github.com/users/wangyibo360/gists{/gist_id}","starred_url":"https://api.github.com/users/wangyibo360/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wangyibo360/subscriptions","organizations_url":"https://api.github.com/users/wangyibo360/orgs","repos_url":"https://api.github.com/users/wangyibo360/repos","events_url":"https://api.github.com/users/wangyibo360/events{/privacy}","received_events_url":"https://api.github.com/users/wangyibo360/received_events","type":"User","site_admin":false},"repo":{"id":57365929,"name":"gunicorn_thrift","full_name":"wangyibo360/gunicorn_thrift","owner":{"login":"wangyibo360","id":11389730,"avatar_url":"https://avatars.githubusercontent.com/u/11389730?v=3","gravatar_id":"","url":"https://api.github.com/users/wangyibo360","html_url":"https://github.com/wangyibo360","followers_url":"https://api.github.com/users/wangyibo360/followers","following_url":"https://api.github.com/users/wangyibo360/following{/other_user}","gists_url":"https://api.github.com/users/wangyibo360/gists{/gist_id}","starred_url":"https://api.github.com/users/wangyibo360/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wangyibo360/subscriptions","organizations_url":"https://api.github.com/users/wangyibo360/orgs","repos_url":"https://api.github.com/users/wangyibo360/repos","events_url":"https://api.github.com/users/wangyibo360/events{/privacy}","received_events_url":"https://api.github.com/users/wangyibo360/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wangyibo360/gunicorn_thrift","description":"Thrift app and worker for gunicorn!","fork":true,"url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift","forks_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/forks","keys_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/teams","hooks_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/hooks","issue_events_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/issues/events{/number}","events_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/events","assignees_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/assignees{/user}","branches_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/branches{/branch}","tags_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/tags","blobs_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/git/refs{/sha}","trees_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/statuses/{sha}","languages_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/languages","stargazers_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/stargazers","contributors_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/contributors","subscribers_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/subscribers","subscription_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/subscription","commits_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/commits{/sha}","git_commits_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/git/commits{/sha}","comments_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/comments{/number}","issue_comment_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/issues/comments{/number}","contents_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/contents/{+path}","compare_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/merges","archive_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/downloads","issues_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/issues{/number}","pulls_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/pulls{/number}","milestones_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/milestones{/number}","notifications_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/labels{/name}","releases_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/releases{/id}","deployments_url":"https://api.github.com/repos/wangyibo360/gunicorn_thrift/deployments","created_at":"2016-04-29T07:47:22Z","updated_at":"2016-04-29T07:47:23Z","pushed_at":"2016-04-29T08:38:54Z","git_url":"git://github.com/wangyibo360/gunicorn_thrift.git","ssh_url":"git@github.com:wangyibo360/gunicorn_thrift.git","clone_url":"https://github.com/wangyibo360/gunicorn_thrift.git","svn_url":"https://github.com/wangyibo360/gunicorn_thrift","homepage":"","size":76,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"eleme:master","ref":"master","sha":"b11cbb83502536ba07a301f76398a34e3fa55401","user":{"login":"eleme","id":1201438,"avatar_url":"https://avatars.githubusercontent.com/u/1201438?v=3","gravatar_id":"","url":"https://api.github.com/users/eleme","html_url":"https://github.com/eleme","followers_url":"https://api.github.com/users/eleme/followers","following_url":"https://api.github.com/users/eleme/following{/other_user}","gists_url":"https://api.github.com/users/eleme/gists{/gist_id}","starred_url":"https://api.github.com/users/eleme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eleme/subscriptions","organizations_url":"https://api.github.com/users/eleme/orgs","repos_url":"https://api.github.com/users/eleme/repos","events_url":"https://api.github.com/users/eleme/events{/privacy}","received_events_url":"https://api.github.com/users/eleme/received_events","type":"Organization","site_admin":false},"repo":{"id":22574757,"name":"gunicorn_thrift","full_name":"eleme/gunicorn_thrift","owner":{"login":"eleme","id":1201438,"avatar_url":"https://avatars.githubusercontent.com/u/1201438?v=3","gravatar_id":"","url":"https://api.github.com/users/eleme","html_url":"https://github.com/eleme","followers_url":"https://api.github.com/users/eleme/followers","following_url":"https://api.github.com/users/eleme/following{/other_user}","gists_url":"https://api.github.com/users/eleme/gists{/gist_id}","starred_url":"https://api.github.com/users/eleme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eleme/subscriptions","organizations_url":"https://api.github.com/users/eleme/orgs","repos_url":"https://api.github.com/users/eleme/repos","events_url":"https://api.github.com/users/eleme/events{/privacy}","received_events_url":"https://api.github.com/users/eleme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eleme/gunicorn_thrift","description":"Thrift app and worker for gunicorn!","fork":false,"url":"https://api.github.com/repos/eleme/gunicorn_thrift","forks_url":"https://api.github.com/repos/eleme/gunicorn_thrift/forks","keys_url":"https://api.github.com/repos/eleme/gunicorn_thrift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eleme/gunicorn_thrift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eleme/gunicorn_thrift/teams","hooks_url":"https://api.github.com/repos/eleme/gunicorn_thrift/hooks","issue_events_url":"https://api.github.com/repos/eleme/gunicorn_thrift/issues/events{/number}","events_url":"https://api.github.com/repos/eleme/gunicorn_thrift/events","assignees_url":"https://api.github.com/repos/eleme/gunicorn_thrift/assignees{/user}","branches_url":"https://api.github.com/repos/eleme/gunicorn_thrift/branches{/branch}","tags_url":"https://api.github.com/repos/eleme/gunicorn_thrift/tags","blobs_url":"https://api.github.com/repos/eleme/gunicorn_thrift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eleme/gunicorn_thrift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eleme/gunicorn_thrift/git/refs{/sha}","trees_url":"https://api.github.com/repos/eleme/gunicorn_thrift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eleme/gunicorn_thrift/statuses/{sha}","languages_url":"https://api.github.com/repos/eleme/gunicorn_thrift/languages","stargazers_url":"https://api.github.com/repos/eleme/gunicorn_thrift/stargazers","contributors_url":"https://api.github.com/repos/eleme/gunicorn_thrift/contributors","subscribers_url":"https://api.github.com/repos/eleme/gunicorn_thrift/subscribers","subscription_url":"https://api.github.com/repos/eleme/gunicorn_thrift/subscription","commits_url":"https://api.github.com/repos/eleme/gunicorn_thrift/commits{/sha}","git_commits_url":"https://api.github.com/repos/eleme/gunicorn_thrift/git/commits{/sha}","comments_url":"https://api.github.com/repos/eleme/gunicorn_thrift/comments{/number}","issue_comment_url":"https://api.github.com/repos/eleme/gunicorn_thrift/issues/comments{/number}","contents_url":"https://api.github.com/repos/eleme/gunicorn_thrift/contents/{+path}","compare_url":"https://api.github.com/repos/eleme/gunicorn_thrift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eleme/gunicorn_thrift/merges","archive_url":"https://api.github.com/repos/eleme/gunicorn_thrift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eleme/gunicorn_thrift/downloads","issues_url":"https://api.github.com/repos/eleme/gunicorn_thrift/issues{/number}","pulls_url":"https://api.github.com/repos/eleme/gunicorn_thrift/pulls{/number}","milestones_url":"https://api.github.com/repos/eleme/gunicorn_thrift/milestones{/number}","notifications_url":"https://api.github.com/repos/eleme/gunicorn_thrift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eleme/gunicorn_thrift/labels{/name}","releases_url":"https://api.github.com/repos/eleme/gunicorn_thrift/releases{/id}","deployments_url":"https://api.github.com/repos/eleme/gunicorn_thrift/deployments","created_at":"2014-08-03T12:50:12Z","updated_at":"2016-05-03T02:03:00Z","pushed_at":"2016-04-29T09:47:02Z","git_url":"git://github.com/eleme/gunicorn_thrift.git","ssh_url":"git@github.com:eleme/gunicorn_thrift.git","clone_url":"https://github.com/eleme/gunicorn_thrift.git","svn_url":"https://github.com/eleme/gunicorn_thrift","homepage":"","size":87,"stargazers_count":34,"watchers_count":34,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"open_issues_count":0,"forks":30,"open_issues":0,"watchers":34,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eleme/gunicorn_thrift/pulls/27"},"html":{"href":"https://github.com/eleme/gunicorn_thrift/pull/27"},"issue":{"href":"https://api.github.com/repos/eleme/gunicorn_thrift/issues/27"},"comments":{"href":"https://api.github.com/repos/eleme/gunicorn_thrift/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/eleme/gunicorn_thrift/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/eleme/gunicorn_thrift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eleme/gunicorn_thrift/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/eleme/gunicorn_thrift/statuses/c5c3166573de2f4013ad52b80d81d90e9cba6675"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":4,"review_comments":0,"commits":1,"additions":148,"deletions":0,"changed_files":4}}