{"action":"opened","number":136,"pull_request":{"url":"https://api.github.com/repos/nsqio/pynsq/pulls/136","id":52623471,"html_url":"https://github.com/nsqio/pynsq/pull/136","diff_url":"https://github.com/nsqio/pynsq/pull/136.diff","patch_url":"https://github.com/nsqio/pynsq/pull/136.patch","issue_url":"https://api.github.com/repos/nsqio/pynsq/issues/136","number":136,"state":"open","locked":false,"title":"remove the signal handler and add a stop function","user":{"login":"DarkNightElves","id":15992102,"avatar_url":"https://avatars.githubusercontent.com/u/15992102?v=3","gravatar_id":"","url":"https://api.github.com/users/DarkNightElves","html_url":"https://github.com/DarkNightElves","followers_url":"https://api.github.com/users/DarkNightElves/followers","following_url":"https://api.github.com/users/DarkNightElves/following{/other_user}","gists_url":"https://api.github.com/users/DarkNightElves/gists{/gist_id}","starred_url":"https://api.github.com/users/DarkNightElves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DarkNightElves/subscriptions","organizations_url":"https://api.github.com/users/DarkNightElves/orgs","repos_url":"https://api.github.com/users/DarkNightElves/repos","events_url":"https://api.github.com/users/DarkNightElves/events{/privacy}","received_events_url":"https://api.github.com/users/DarkNightElves/received_events","type":"User","site_admin":false},"body":"i think that the signals should be handled by the users themselves. if you capture these signals here, users cannot capture them again.\r\n\r\ni am writing a script these days, which fetch messages from nsq and then save to mysql. to impore performance, the program store the messages in an array , and then insert  into mysql at one time when the count achieve 100. so if the program is killed, maybe there are still a batch of messages waiting to be saved to mysql. to  avoid data lost, i should handle the signals myself. but i cannot because these signals are already captured  here.\r\n\r\non the other hand,  i think users should have the ability to stop the nsq manually,  so i add a stop function.","created_at":"2015-12-04T02:42:50Z","updated_at":"2015-12-04T02:42:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af53b3ee9ff437d3637b5e320378bf95338dd14a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nsqio/pynsq/pulls/136/commits","review_comments_url":"https://api.github.com/repos/nsqio/pynsq/pulls/136/comments","review_comment_url":"https://api.github.com/repos/nsqio/pynsq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nsqio/pynsq/issues/136/comments","statuses_url":"https://api.github.com/repos/nsqio/pynsq/statuses/aca8d27dc94b8f5c4879c3b89e31d5aff64759ca","head":{"label":"DarkNightElves:patch-1","ref":"patch-1","sha":"aca8d27dc94b8f5c4879c3b89e31d5aff64759ca","user":{"login":"DarkNightElves","id":15992102,"avatar_url":"https://avatars.githubusercontent.com/u/15992102?v=3","gravatar_id":"","url":"https://api.github.com/users/DarkNightElves","html_url":"https://github.com/DarkNightElves","followers_url":"https://api.github.com/users/DarkNightElves/followers","following_url":"https://api.github.com/users/DarkNightElves/following{/other_user}","gists_url":"https://api.github.com/users/DarkNightElves/gists{/gist_id}","starred_url":"https://api.github.com/users/DarkNightElves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DarkNightElves/subscriptions","organizations_url":"https://api.github.com/users/DarkNightElves/orgs","repos_url":"https://api.github.com/users/DarkNightElves/repos","events_url":"https://api.github.com/users/DarkNightElves/events{/privacy}","received_events_url":"https://api.github.com/users/DarkNightElves/received_events","type":"User","site_admin":false},"repo":{"id":47374726,"name":"pynsq","full_name":"DarkNightElves/pynsq","owner":{"login":"DarkNightElves","id":15992102,"avatar_url":"https://avatars.githubusercontent.com/u/15992102?v=3","gravatar_id":"","url":"https://api.github.com/users/DarkNightElves","html_url":"https://github.com/DarkNightElves","followers_url":"https://api.github.com/users/DarkNightElves/followers","following_url":"https://api.github.com/users/DarkNightElves/following{/other_user}","gists_url":"https://api.github.com/users/DarkNightElves/gists{/gist_id}","starred_url":"https://api.github.com/users/DarkNightElves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DarkNightElves/subscriptions","organizations_url":"https://api.github.com/users/DarkNightElves/orgs","repos_url":"https://api.github.com/users/DarkNightElves/repos","events_url":"https://api.github.com/users/DarkNightElves/events{/privacy}","received_events_url":"https://api.github.com/users/DarkNightElves/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DarkNightElves/pynsq","description":"The official Python client library for NSQ","fork":true,"url":"https://api.github.com/repos/DarkNightElves/pynsq","forks_url":"https://api.github.com/repos/DarkNightElves/pynsq/forks","keys_url":"https://api.github.com/repos/DarkNightElves/pynsq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DarkNightElves/pynsq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DarkNightElves/pynsq/teams","hooks_url":"https://api.github.com/repos/DarkNightElves/pynsq/hooks","issue_events_url":"https://api.github.com/repos/DarkNightElves/pynsq/issues/events{/number}","events_url":"https://api.github.com/repos/DarkNightElves/pynsq/events","assignees_url":"https://api.github.com/repos/DarkNightElves/pynsq/assignees{/user}","branches_url":"https://api.github.com/repos/DarkNightElves/pynsq/branches{/branch}","tags_url":"https://api.github.com/repos/DarkNightElves/pynsq/tags","blobs_url":"https://api.github.com/repos/DarkNightElves/pynsq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DarkNightElves/pynsq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DarkNightElves/pynsq/git/refs{/sha}","trees_url":"https://api.github.com/repos/DarkNightElves/pynsq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DarkNightElves/pynsq/statuses/{sha}","languages_url":"https://api.github.com/repos/DarkNightElves/pynsq/languages","stargazers_url":"https://api.github.com/repos/DarkNightElves/pynsq/stargazers","contributors_url":"https://api.github.com/repos/DarkNightElves/pynsq/contributors","subscribers_url":"https://api.github.com/repos/DarkNightElves/pynsq/subscribers","subscription_url":"https://api.github.com/repos/DarkNightElves/pynsq/subscription","commits_url":"https://api.github.com/repos/DarkNightElves/pynsq/commits{/sha}","git_commits_url":"https://api.github.com/repos/DarkNightElves/pynsq/git/commits{/sha}","comments_url":"https://api.github.com/repos/DarkNightElves/pynsq/comments{/number}","issue_comment_url":"https://api.github.com/repos/DarkNightElves/pynsq/issues/comments{/number}","contents_url":"https://api.github.com/repos/DarkNightElves/pynsq/contents/{+path}","compare_url":"https://api.github.com/repos/DarkNightElves/pynsq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DarkNightElves/pynsq/merges","archive_url":"https://api.github.com/repos/DarkNightElves/pynsq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DarkNightElves/pynsq/downloads","issues_url":"https://api.github.com/repos/DarkNightElves/pynsq/issues{/number}","pulls_url":"https://api.github.com/repos/DarkNightElves/pynsq/pulls{/number}","milestones_url":"https://api.github.com/repos/DarkNightElves/pynsq/milestones{/number}","notifications_url":"https://api.github.com/repos/DarkNightElves/pynsq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DarkNightElves/pynsq/labels{/name}","releases_url":"https://api.github.com/repos/DarkNightElves/pynsq/releases{/id}","created_at":"2015-12-04T02:09:35Z","updated_at":"2015-12-04T02:09:36Z","pushed_at":"2015-12-04T02:41:22Z","git_url":"git://github.com/DarkNightElves/pynsq.git","ssh_url":"git@github.com:DarkNightElves/pynsq.git","clone_url":"https://github.com/DarkNightElves/pynsq.git","svn_url":"https://github.com/DarkNightElves/pynsq","homepage":"","size":323,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"nsqio:master","ref":"master","sha":"8789084b3beb638c547cf8ed4b2a70bb4c982278","user":{"login":"nsqio","id":8295919,"avatar_url":"https://avatars.githubusercontent.com/u/8295919?v=3","gravatar_id":"","url":"https://api.github.com/users/nsqio","html_url":"https://github.com/nsqio","followers_url":"https://api.github.com/users/nsqio/followers","following_url":"https://api.github.com/users/nsqio/following{/other_user}","gists_url":"https://api.github.com/users/nsqio/gists{/gist_id}","starred_url":"https://api.github.com/users/nsqio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsqio/subscriptions","organizations_url":"https://api.github.com/users/nsqio/orgs","repos_url":"https://api.github.com/users/nsqio/repos","events_url":"https://api.github.com/users/nsqio/events{/privacy}","received_events_url":"https://api.github.com/users/nsqio/received_events","type":"Organization","site_admin":false},"repo":{"id":6475842,"name":"pynsq","full_name":"nsqio/pynsq","owner":{"login":"nsqio","id":8295919,"avatar_url":"https://avatars.githubusercontent.com/u/8295919?v=3","gravatar_id":"","url":"https://api.github.com/users/nsqio","html_url":"https://github.com/nsqio","followers_url":"https://api.github.com/users/nsqio/followers","following_url":"https://api.github.com/users/nsqio/following{/other_user}","gists_url":"https://api.github.com/users/nsqio/gists{/gist_id}","starred_url":"https://api.github.com/users/nsqio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsqio/subscriptions","organizations_url":"https://api.github.com/users/nsqio/orgs","repos_url":"https://api.github.com/users/nsqio/repos","events_url":"https://api.github.com/users/nsqio/events{/privacy}","received_events_url":"https://api.github.com/users/nsqio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nsqio/pynsq","description":"The official Python client library for NSQ","fork":false,"url":"https://api.github.com/repos/nsqio/pynsq","forks_url":"https://api.github.com/repos/nsqio/pynsq/forks","keys_url":"https://api.github.com/repos/nsqio/pynsq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nsqio/pynsq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nsqio/pynsq/teams","hooks_url":"https://api.github.com/repos/nsqio/pynsq/hooks","issue_events_url":"https://api.github.com/repos/nsqio/pynsq/issues/events{/number}","events_url":"https://api.github.com/repos/nsqio/pynsq/events","assignees_url":"https://api.github.com/repos/nsqio/pynsq/assignees{/user}","branches_url":"https://api.github.com/repos/nsqio/pynsq/branches{/branch}","tags_url":"https://api.github.com/repos/nsqio/pynsq/tags","blobs_url":"https://api.github.com/repos/nsqio/pynsq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nsqio/pynsq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nsqio/pynsq/git/refs{/sha}","trees_url":"https://api.github.com/repos/nsqio/pynsq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nsqio/pynsq/statuses/{sha}","languages_url":"https://api.github.com/repos/nsqio/pynsq/languages","stargazers_url":"https://api.github.com/repos/nsqio/pynsq/stargazers","contributors_url":"https://api.github.com/repos/nsqio/pynsq/contributors","subscribers_url":"https://api.github.com/repos/nsqio/pynsq/subscribers","subscription_url":"https://api.github.com/repos/nsqio/pynsq/subscription","commits_url":"https://api.github.com/repos/nsqio/pynsq/commits{/sha}","git_commits_url":"https://api.github.com/repos/nsqio/pynsq/git/commits{/sha}","comments_url":"https://api.github.com/repos/nsqio/pynsq/comments{/number}","issue_comment_url":"https://api.github.com/repos/nsqio/pynsq/issues/comments{/number}","contents_url":"https://api.github.com/repos/nsqio/pynsq/contents/{+path}","compare_url":"https://api.github.com/repos/nsqio/pynsq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nsqio/pynsq/merges","archive_url":"https://api.github.com/repos/nsqio/pynsq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nsqio/pynsq/downloads","issues_url":"https://api.github.com/repos/nsqio/pynsq/issues{/number}","pulls_url":"https://api.github.com/repos/nsqio/pynsq/pulls{/number}","milestones_url":"https://api.github.com/repos/nsqio/pynsq/milestones{/number}","notifications_url":"https://api.github.com/repos/nsqio/pynsq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nsqio/pynsq/labels{/name}","releases_url":"https://api.github.com/repos/nsqio/pynsq/releases{/id}","created_at":"2012-10-31T15:09:40Z","updated_at":"2015-11-23T05:33:50Z","pushed_at":"2015-12-04T02:42:50Z","git_url":"git://github.com/nsqio/pynsq.git","ssh_url":"git@github.com:nsqio/pynsq.git","clone_url":"https://github.com/nsqio/pynsq.git","svn_url":"https://github.com/nsqio/pynsq","homepage":"","size":1231,"stargazers_count":155,"watchers_count":155,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":66,"mirror_url":null,"open_issues_count":9,"forks":66,"open_issues":9,"watchers":155,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nsqio/pynsq/pulls/136"},"html":{"href":"https://github.com/nsqio/pynsq/pull/136"},"issue":{"href":"https://api.github.com/repos/nsqio/pynsq/issues/136"},"comments":{"href":"https://api.github.com/repos/nsqio/pynsq/issues/136/comments"},"review_comments":{"href":"https://api.github.com/repos/nsqio/pynsq/pulls/136/comments"},"review_comment":{"href":"https://api.github.com/repos/nsqio/pynsq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nsqio/pynsq/pulls/136/commits"},"statuses":{"href":"https://api.github.com/repos/nsqio/pynsq/statuses/aca8d27dc94b8f5c4879c3b89e31d5aff64759ca"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":4,"deletions":6,"changed_files":1}}