{"action":"created","comment":{"url":"https://api.github.com/repos/chvanikoff/apns4ex/pulls/comments/57906084","id":57906084,"diff_hunk":"@@ -0,0 +1,16 @@\n+defmodule APNS.State do\n+  def get(options) do\n+    {:ok, queue_pid} = APNS.Queue.start_link","path":"lib/apns/state.ex","position":3,"original_position":3,"commit_id":"9b177bf793d3901b111e4d73896c9131edb8300c","original_commit_id":"9b177bf793d3901b111e4d73896c9131edb8300c","user":{"login":"benwilson512","id":247817,"avatar_url":"https://avatars.githubusercontent.com/u/247817?v=3","gravatar_id":"","url":"https://api.github.com/users/benwilson512","html_url":"https://github.com/benwilson512","followers_url":"https://api.github.com/users/benwilson512/followers","following_url":"https://api.github.com/users/benwilson512/following{/other_user}","gists_url":"https://api.github.com/users/benwilson512/gists{/gist_id}","starred_url":"https://api.github.com/users/benwilson512/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benwilson512/subscriptions","organizations_url":"https://api.github.com/users/benwilson512/orgs","repos_url":"https://api.github.com/users/benwilson512/repos","events_url":"https://api.github.com/users/benwilson512/events{/privacy}","received_events_url":"https://api.github.com/users/benwilson512/received_events","type":"User","site_admin":false},"body":"Better really because you won't have message passing overhead, we don't have to solve the problem of having the queue supervised, etc.","created_at":"2016-03-30T15:15:33Z","updated_at":"2016-03-30T15:15:33Z","html_url":"https://github.com/chvanikoff/apns4ex/pull/32#discussion_r57906084","pull_request_url":"https://api.github.com/repos/chvanikoff/apns4ex/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/chvanikoff/apns4ex/pulls/comments/57906084"},"html":{"href":"https://github.com/chvanikoff/apns4ex/pull/32#discussion_r57906084"},"pull_request":{"href":"https://api.github.com/repos/chvanikoff/apns4ex/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/chvanikoff/apns4ex/pulls/32","id":64030723,"html_url":"https://github.com/chvanikoff/apns4ex/pull/32","diff_url":"https://github.com/chvanikoff/apns4ex/pull/32.diff","patch_url":"https://github.com/chvanikoff/apns4ex/pull/32.patch","issue_url":"https://api.github.com/repos/chvanikoff/apns4ex/issues/32","number":32,"state":"open","locked":false,"title":"Resend messages on failure","user":{"login":"ramhoj","id":116923,"avatar_url":"https://avatars.githubusercontent.com/u/116923?v=3","gravatar_id":"","url":"https://api.github.com/users/ramhoj","html_url":"https://github.com/ramhoj","followers_url":"https://api.github.com/users/ramhoj/followers","following_url":"https://api.github.com/users/ramhoj/following{/other_user}","gists_url":"https://api.github.com/users/ramhoj/gists{/gist_id}","starred_url":"https://api.github.com/users/ramhoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramhoj/subscriptions","organizations_url":"https://api.github.com/users/ramhoj/orgs","repos_url":"https://api.github.com/users/ramhoj/repos","events_url":"https://api.github.com/users/ramhoj/events{/privacy}","received_events_url":"https://api.github.com/users/ramhoj/received_events","type":"User","site_admin":false},"body":"closes #29\r\ncontributes to #4\r\nsuggests that #3 dependency injection might be a pragmatic first step to test more of the code*\r\n\r\nThis, quite large PR, makes the lib resend messages that comes after an error response from Apple since these messages are otherwise never delivered.\r\n\r\nThere are a few things that can be improved that we might add in a later PR that is related to re-sending messages that this PR doesn't include:\r\n\r\n* re-try on :ssl error\r\n* handle message expiry\r\n\r\nThe queue implementation is inspired by apns4erl.\r\n\r\nTo verify that this addition actually works we found our self in a position where we really wanted a better safety net in the form of unit tests to rely on. Therefore this PR also includes a split of `APNS.Worker` into several smaller modules and adds unit tests for most of them.\r\n\r\nPlease let us know what you think, we're happy to get feedback on naming, separation etc.\r\n\r\n\\* We tried using https://github.com/pdincau/mockapn which caused a lot of trouble (we couldn't find a way to start and stop the service in a dependable way)","created_at":"2016-03-24T13:05:20Z","updated_at":"2016-03-30T15:15:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0beabb5cd953d4ce96f2a01f06e65e85c3aaa4e3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chvanikoff/apns4ex/pulls/32/commits","review_comments_url":"https://api.github.com/repos/chvanikoff/apns4ex/pulls/32/comments","review_comment_url":"https://api.github.com/repos/chvanikoff/apns4ex/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chvanikoff/apns4ex/issues/32/comments","statuses_url":"https://api.github.com/repos/chvanikoff/apns4ex/statuses/9b177bf793d3901b111e4d73896c9131edb8300c","head":{"label":"elabs:resend-messages-on-failure","ref":"resend-messages-on-failure","sha":"9b177bf793d3901b111e4d73896c9131edb8300c","user":{"login":"elabs","id":34438,"avatar_url":"https://avatars.githubusercontent.com/u/34438?v=3","gravatar_id":"","url":"https://api.github.com/users/elabs","html_url":"https://github.com/elabs","followers_url":"https://api.github.com/users/elabs/followers","following_url":"https://api.github.com/users/elabs/following{/other_user}","gists_url":"https://api.github.com/users/elabs/gists{/gist_id}","starred_url":"https://api.github.com/users/elabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elabs/subscriptions","organizations_url":"https://api.github.com/users/elabs/orgs","repos_url":"https://api.github.com/users/elabs/repos","events_url":"https://api.github.com/users/elabs/events{/privacy}","received_events_url":"https://api.github.com/users/elabs/received_events","type":"Organization","site_admin":false},"repo":{"id":46799136,"name":"apns4ex","full_name":"elabs/apns4ex","owner":{"login":"elabs","id":34438,"avatar_url":"https://avatars.githubusercontent.com/u/34438?v=3","gravatar_id":"","url":"https://api.github.com/users/elabs","html_url":"https://github.com/elabs","followers_url":"https://api.github.com/users/elabs/followers","following_url":"https://api.github.com/users/elabs/following{/other_user}","gists_url":"https://api.github.com/users/elabs/gists{/gist_id}","starred_url":"https://api.github.com/users/elabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elabs/subscriptions","organizations_url":"https://api.github.com/users/elabs/orgs","repos_url":"https://api.github.com/users/elabs/repos","events_url":"https://api.github.com/users/elabs/events{/privacy}","received_events_url":"https://api.github.com/users/elabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elabs/apns4ex","description":"APNS for Elixir","fork":true,"url":"https://api.github.com/repos/elabs/apns4ex","forks_url":"https://api.github.com/repos/elabs/apns4ex/forks","keys_url":"https://api.github.com/repos/elabs/apns4ex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elabs/apns4ex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elabs/apns4ex/teams","hooks_url":"https://api.github.com/repos/elabs/apns4ex/hooks","issue_events_url":"https://api.github.com/repos/elabs/apns4ex/issues/events{/number}","events_url":"https://api.github.com/repos/elabs/apns4ex/events","assignees_url":"https://api.github.com/repos/elabs/apns4ex/assignees{/user}","branches_url":"https://api.github.com/repos/elabs/apns4ex/branches{/branch}","tags_url":"https://api.github.com/repos/elabs/apns4ex/tags","blobs_url":"https://api.github.com/repos/elabs/apns4ex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elabs/apns4ex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elabs/apns4ex/git/refs{/sha}","trees_url":"https://api.github.com/repos/elabs/apns4ex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elabs/apns4ex/statuses/{sha}","languages_url":"https://api.github.com/repos/elabs/apns4ex/languages","stargazers_url":"https://api.github.com/repos/elabs/apns4ex/stargazers","contributors_url":"https://api.github.com/repos/elabs/apns4ex/contributors","subscribers_url":"https://api.github.com/repos/elabs/apns4ex/subscribers","subscription_url":"https://api.github.com/repos/elabs/apns4ex/subscription","commits_url":"https://api.github.com/repos/elabs/apns4ex/commits{/sha}","git_commits_url":"https://api.github.com/repos/elabs/apns4ex/git/commits{/sha}","comments_url":"https://api.github.com/repos/elabs/apns4ex/comments{/number}","issue_comment_url":"https://api.github.com/repos/elabs/apns4ex/issues/comments{/number}","contents_url":"https://api.github.com/repos/elabs/apns4ex/contents/{+path}","compare_url":"https://api.github.com/repos/elabs/apns4ex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elabs/apns4ex/merges","archive_url":"https://api.github.com/repos/elabs/apns4ex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elabs/apns4ex/downloads","issues_url":"https://api.github.com/repos/elabs/apns4ex/issues{/number}","pulls_url":"https://api.github.com/repos/elabs/apns4ex/pulls{/number}","milestones_url":"https://api.github.com/repos/elabs/apns4ex/milestones{/number}","notifications_url":"https://api.github.com/repos/elabs/apns4ex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elabs/apns4ex/labels{/name}","releases_url":"https://api.github.com/repos/elabs/apns4ex/releases{/id}","deployments_url":"https://api.github.com/repos/elabs/apns4ex/deployments","created_at":"2015-11-24T15:07:44Z","updated_at":"2016-02-10T08:46:04Z","pushed_at":"2016-03-30T13:07:03Z","git_url":"git://github.com/elabs/apns4ex.git","ssh_url":"git@github.com:elabs/apns4ex.git","clone_url":"https://github.com/elabs/apns4ex.git","svn_url":"https://github.com/elabs/apns4ex","homepage":null,"size":76,"stargazers_count":0,"watchers_count":0,"language":"Elixir","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":"chvanikoff:master","ref":"master","sha":"b3a1e6dc32101506f54e3fb53b59ae516ba51947","user":{"login":"chvanikoff","id":452592,"avatar_url":"https://avatars.githubusercontent.com/u/452592?v=3","gravatar_id":"","url":"https://api.github.com/users/chvanikoff","html_url":"https://github.com/chvanikoff","followers_url":"https://api.github.com/users/chvanikoff/followers","following_url":"https://api.github.com/users/chvanikoff/following{/other_user}","gists_url":"https://api.github.com/users/chvanikoff/gists{/gist_id}","starred_url":"https://api.github.com/users/chvanikoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chvanikoff/subscriptions","organizations_url":"https://api.github.com/users/chvanikoff/orgs","repos_url":"https://api.github.com/users/chvanikoff/repos","events_url":"https://api.github.com/users/chvanikoff/events{/privacy}","received_events_url":"https://api.github.com/users/chvanikoff/received_events","type":"User","site_admin":false},"repo":{"id":42089133,"name":"apns4ex","full_name":"chvanikoff/apns4ex","owner":{"login":"chvanikoff","id":452592,"avatar_url":"https://avatars.githubusercontent.com/u/452592?v=3","gravatar_id":"","url":"https://api.github.com/users/chvanikoff","html_url":"https://github.com/chvanikoff","followers_url":"https://api.github.com/users/chvanikoff/followers","following_url":"https://api.github.com/users/chvanikoff/following{/other_user}","gists_url":"https://api.github.com/users/chvanikoff/gists{/gist_id}","starred_url":"https://api.github.com/users/chvanikoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chvanikoff/subscriptions","organizations_url":"https://api.github.com/users/chvanikoff/orgs","repos_url":"https://api.github.com/users/chvanikoff/repos","events_url":"https://api.github.com/users/chvanikoff/events{/privacy}","received_events_url":"https://api.github.com/users/chvanikoff/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chvanikoff/apns4ex","description":"APNS for Elixir","fork":false,"url":"https://api.github.com/repos/chvanikoff/apns4ex","forks_url":"https://api.github.com/repos/chvanikoff/apns4ex/forks","keys_url":"https://api.github.com/repos/chvanikoff/apns4ex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chvanikoff/apns4ex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chvanikoff/apns4ex/teams","hooks_url":"https://api.github.com/repos/chvanikoff/apns4ex/hooks","issue_events_url":"https://api.github.com/repos/chvanikoff/apns4ex/issues/events{/number}","events_url":"https://api.github.com/repos/chvanikoff/apns4ex/events","assignees_url":"https://api.github.com/repos/chvanikoff/apns4ex/assignees{/user}","branches_url":"https://api.github.com/repos/chvanikoff/apns4ex/branches{/branch}","tags_url":"https://api.github.com/repos/chvanikoff/apns4ex/tags","blobs_url":"https://api.github.com/repos/chvanikoff/apns4ex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chvanikoff/apns4ex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chvanikoff/apns4ex/git/refs{/sha}","trees_url":"https://api.github.com/repos/chvanikoff/apns4ex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chvanikoff/apns4ex/statuses/{sha}","languages_url":"https://api.github.com/repos/chvanikoff/apns4ex/languages","stargazers_url":"https://api.github.com/repos/chvanikoff/apns4ex/stargazers","contributors_url":"https://api.github.com/repos/chvanikoff/apns4ex/contributors","subscribers_url":"https://api.github.com/repos/chvanikoff/apns4ex/subscribers","subscription_url":"https://api.github.com/repos/chvanikoff/apns4ex/subscription","commits_url":"https://api.github.com/repos/chvanikoff/apns4ex/commits{/sha}","git_commits_url":"https://api.github.com/repos/chvanikoff/apns4ex/git/commits{/sha}","comments_url":"https://api.github.com/repos/chvanikoff/apns4ex/comments{/number}","issue_comment_url":"https://api.github.com/repos/chvanikoff/apns4ex/issues/comments{/number}","contents_url":"https://api.github.com/repos/chvanikoff/apns4ex/contents/{+path}","compare_url":"https://api.github.com/repos/chvanikoff/apns4ex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chvanikoff/apns4ex/merges","archive_url":"https://api.github.com/repos/chvanikoff/apns4ex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chvanikoff/apns4ex/downloads","issues_url":"https://api.github.com/repos/chvanikoff/apns4ex/issues{/number}","pulls_url":"https://api.github.com/repos/chvanikoff/apns4ex/pulls{/number}","milestones_url":"https://api.github.com/repos/chvanikoff/apns4ex/milestones{/number}","notifications_url":"https://api.github.com/repos/chvanikoff/apns4ex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chvanikoff/apns4ex/labels{/name}","releases_url":"https://api.github.com/repos/chvanikoff/apns4ex/releases{/id}","deployments_url":"https://api.github.com/repos/chvanikoff/apns4ex/deployments","created_at":"2015-09-08T03:59:06Z","updated_at":"2016-03-30T10:26:28Z","pushed_at":"2016-03-30T13:07:04Z","git_url":"git://github.com/chvanikoff/apns4ex.git","ssh_url":"git@github.com:chvanikoff/apns4ex.git","clone_url":"https://github.com/chvanikoff/apns4ex.git","svn_url":"https://github.com/chvanikoff/apns4ex","homepage":null,"size":62,"stargazers_count":28,"watchers_count":28,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":7,"forks":14,"open_issues":7,"watchers":28,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chvanikoff/apns4ex/pulls/32"},"html":{"href":"https://github.com/chvanikoff/apns4ex/pull/32"},"issue":{"href":"https://api.github.com/repos/chvanikoff/apns4ex/issues/32"},"comments":{"href":"https://api.github.com/repos/chvanikoff/apns4ex/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/chvanikoff/apns4ex/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/chvanikoff/apns4ex/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chvanikoff/apns4ex/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/chvanikoff/apns4ex/statuses/9b177bf793d3901b111e4d73896c9131edb8300c"}}}}