{"action":"created","comment":{"url":"https://api.github.com/repos/artygus/scheduler/pulls/comments/170247240","pull_request_review_id":98906747,"id":170247240,"diff_hunk":"@@ -0,0 +1,39 @@\n+require \"google/cloud/pubsub\"\n+\n+AWESOME_SCHEDULER_CREDENTIALS = {\n+  project_id: \"my-project-id\",\n+  emulator_host: \"localhost:8085\"\n+}.freeze\n+\n+class AwesomeScheduler\n+  def initialize\n+    @pubsub = Google::Cloud::Pubsub.new(AWESOME_SCHEDULER_CREDENTIALS)\n+    @topic = @pubsub.topic \"jobs\"\n+    @topic ||= @pubsub.create_topic \"jobs\"\n+  end\n+\n+  def queue(message)\n+    @topic.publish(message)\n+  end\n+\n+  def process\n+    subscription = @topic.subscription \"pop\"\n+    subscription ||= @topic.subscribe \"pop\"\n+\n+    subscriber = subscription.listen do |received_message|\n+      serialized_job = JSON.parse(received_message.data)","path":"lib/awesome_scheduler.rb","position":24,"original_position":24,"commit_id":"6ca96cfe921e8285271b3097f53bd519d61bb992","original_commit_id":"6ca96cfe921e8285271b3097f53bd519d61bb992","user":{"login":"ce07c3","id":6344545,"avatar_url":"https://avatars0.githubusercontent.com/u/6344545?v=4","gravatar_id":"","url":"https://api.github.com/users/ce07c3","html_url":"https://github.com/ce07c3","followers_url":"https://api.github.com/users/ce07c3/followers","following_url":"https://api.github.com/users/ce07c3/following{/other_user}","gists_url":"https://api.github.com/users/ce07c3/gists{/gist_id}","starred_url":"https://api.github.com/users/ce07c3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ce07c3/subscriptions","organizations_url":"https://api.github.com/users/ce07c3/orgs","repos_url":"https://api.github.com/users/ce07c3/repos","events_url":"https://api.github.com/users/ce07c3/events{/privacy}","received_events_url":"https://api.github.com/users/ce07c3/received_events","type":"User","site_admin":false},"body":"You can use ActiveJob to deserialize","created_at":"2018-02-23T13:11:16Z","updated_at":"2018-02-23T13:11:24Z","html_url":"https://github.com/artygus/scheduler/pull/2#discussion_r170247240","pull_request_url":"https://api.github.com/repos/artygus/scheduler/pulls/2","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/artygus/scheduler/pulls/comments/170247240"},"html":{"href":"https://github.com/artygus/scheduler/pull/2#discussion_r170247240"},"pull_request":{"href":"https://api.github.com/repos/artygus/scheduler/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/artygus/scheduler/pulls/2","id":170993353,"html_url":"https://github.com/artygus/scheduler/pull/2","diff_url":"https://github.com/artygus/scheduler/pull/2.diff","patch_url":"https://github.com/artygus/scheduler/pull/2.patch","issue_url":"https://api.github.com/repos/artygus/scheduler/issues/2","number":2,"state":"open","locked":false,"title":"Basic scheduler class","user":{"login":"artygus","id":4974968,"avatar_url":"https://avatars3.githubusercontent.com/u/4974968?v=4","gravatar_id":"","url":"https://api.github.com/users/artygus","html_url":"https://github.com/artygus","followers_url":"https://api.github.com/users/artygus/followers","following_url":"https://api.github.com/users/artygus/following{/other_user}","gists_url":"https://api.github.com/users/artygus/gists{/gist_id}","starred_url":"https://api.github.com/users/artygus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artygus/subscriptions","organizations_url":"https://api.github.com/users/artygus/orgs","repos_url":"https://api.github.com/users/artygus/repos","events_url":"https://api.github.com/users/artygus/events{/privacy}","received_events_url":"https://api.github.com/users/artygus/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-23T11:31:38Z","updated_at":"2018-02-23T13:11:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"28f3a139a4c7bf69eccc9b91fb7da174fa481601","assignee":{"login":"artygus","id":4974968,"avatar_url":"https://avatars3.githubusercontent.com/u/4974968?v=4","gravatar_id":"","url":"https://api.github.com/users/artygus","html_url":"https://github.com/artygus","followers_url":"https://api.github.com/users/artygus/followers","following_url":"https://api.github.com/users/artygus/following{/other_user}","gists_url":"https://api.github.com/users/artygus/gists{/gist_id}","starred_url":"https://api.github.com/users/artygus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artygus/subscriptions","organizations_url":"https://api.github.com/users/artygus/orgs","repos_url":"https://api.github.com/users/artygus/repos","events_url":"https://api.github.com/users/artygus/events{/privacy}","received_events_url":"https://api.github.com/users/artygus/received_events","type":"User","site_admin":false},"assignees":[{"login":"artygus","id":4974968,"avatar_url":"https://avatars3.githubusercontent.com/u/4974968?v=4","gravatar_id":"","url":"https://api.github.com/users/artygus","html_url":"https://github.com/artygus","followers_url":"https://api.github.com/users/artygus/followers","following_url":"https://api.github.com/users/artygus/following{/other_user}","gists_url":"https://api.github.com/users/artygus/gists{/gist_id}","starred_url":"https://api.github.com/users/artygus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artygus/subscriptions","organizations_url":"https://api.github.com/users/artygus/orgs","repos_url":"https://api.github.com/users/artygus/repos","events_url":"https://api.github.com/users/artygus/events{/privacy}","received_events_url":"https://api.github.com/users/artygus/received_events","type":"User","site_admin":false},{"login":"ce07c3","id":6344545,"avatar_url":"https://avatars0.githubusercontent.com/u/6344545?v=4","gravatar_id":"","url":"https://api.github.com/users/ce07c3","html_url":"https://github.com/ce07c3","followers_url":"https://api.github.com/users/ce07c3/followers","following_url":"https://api.github.com/users/ce07c3/following{/other_user}","gists_url":"https://api.github.com/users/ce07c3/gists{/gist_id}","starred_url":"https://api.github.com/users/ce07c3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ce07c3/subscriptions","organizations_url":"https://api.github.com/users/ce07c3/orgs","repos_url":"https://api.github.com/users/ce07c3/repos","events_url":"https://api.github.com/users/ce07c3/events{/privacy}","received_events_url":"https://api.github.com/users/ce07c3/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/artygus/scheduler/pulls/2/commits","review_comments_url":"https://api.github.com/repos/artygus/scheduler/pulls/2/comments","review_comment_url":"https://api.github.com/repos/artygus/scheduler/pulls/comments{/number}","comments_url":"https://api.github.com/repos/artygus/scheduler/issues/2/comments","statuses_url":"https://api.github.com/repos/artygus/scheduler/statuses/6ca96cfe921e8285271b3097f53bd519d61bb992","head":{"label":"artygus:basic_scheduler","ref":"basic_scheduler","sha":"6ca96cfe921e8285271b3097f53bd519d61bb992","user":{"login":"artygus","id":4974968,"avatar_url":"https://avatars3.githubusercontent.com/u/4974968?v=4","gravatar_id":"","url":"https://api.github.com/users/artygus","html_url":"https://github.com/artygus","followers_url":"https://api.github.com/users/artygus/followers","following_url":"https://api.github.com/users/artygus/following{/other_user}","gists_url":"https://api.github.com/users/artygus/gists{/gist_id}","starred_url":"https://api.github.com/users/artygus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artygus/subscriptions","organizations_url":"https://api.github.com/users/artygus/orgs","repos_url":"https://api.github.com/users/artygus/repos","events_url":"https://api.github.com/users/artygus/events{/privacy}","received_events_url":"https://api.github.com/users/artygus/received_events","type":"User","site_admin":false},"repo":{"id":122606364,"name":"scheduler","full_name":"artygus/scheduler","owner":{"login":"artygus","id":4974968,"avatar_url":"https://avatars3.githubusercontent.com/u/4974968?v=4","gravatar_id":"","url":"https://api.github.com/users/artygus","html_url":"https://github.com/artygus","followers_url":"https://api.github.com/users/artygus/followers","following_url":"https://api.github.com/users/artygus/following{/other_user}","gists_url":"https://api.github.com/users/artygus/gists{/gist_id}","starred_url":"https://api.github.com/users/artygus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artygus/subscriptions","organizations_url":"https://api.github.com/users/artygus/orgs","repos_url":"https://api.github.com/users/artygus/repos","events_url":"https://api.github.com/users/artygus/events{/privacy}","received_events_url":"https://api.github.com/users/artygus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/artygus/scheduler","description":null,"fork":false,"url":"https://api.github.com/repos/artygus/scheduler","forks_url":"https://api.github.com/repos/artygus/scheduler/forks","keys_url":"https://api.github.com/repos/artygus/scheduler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/artygus/scheduler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/artygus/scheduler/teams","hooks_url":"https://api.github.com/repos/artygus/scheduler/hooks","issue_events_url":"https://api.github.com/repos/artygus/scheduler/issues/events{/number}","events_url":"https://api.github.com/repos/artygus/scheduler/events","assignees_url":"https://api.github.com/repos/artygus/scheduler/assignees{/user}","branches_url":"https://api.github.com/repos/artygus/scheduler/branches{/branch}","tags_url":"https://api.github.com/repos/artygus/scheduler/tags","blobs_url":"https://api.github.com/repos/artygus/scheduler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/artygus/scheduler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/artygus/scheduler/git/refs{/sha}","trees_url":"https://api.github.com/repos/artygus/scheduler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/artygus/scheduler/statuses/{sha}","languages_url":"https://api.github.com/repos/artygus/scheduler/languages","stargazers_url":"https://api.github.com/repos/artygus/scheduler/stargazers","contributors_url":"https://api.github.com/repos/artygus/scheduler/contributors","subscribers_url":"https://api.github.com/repos/artygus/scheduler/subscribers","subscription_url":"https://api.github.com/repos/artygus/scheduler/subscription","commits_url":"https://api.github.com/repos/artygus/scheduler/commits{/sha}","git_commits_url":"https://api.github.com/repos/artygus/scheduler/git/commits{/sha}","comments_url":"https://api.github.com/repos/artygus/scheduler/comments{/number}","issue_comment_url":"https://api.github.com/repos/artygus/scheduler/issues/comments{/number}","contents_url":"https://api.github.com/repos/artygus/scheduler/contents/{+path}","compare_url":"https://api.github.com/repos/artygus/scheduler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/artygus/scheduler/merges","archive_url":"https://api.github.com/repos/artygus/scheduler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/artygus/scheduler/downloads","issues_url":"https://api.github.com/repos/artygus/scheduler/issues{/number}","pulls_url":"https://api.github.com/repos/artygus/scheduler/pulls{/number}","milestones_url":"https://api.github.com/repos/artygus/scheduler/milestones{/number}","notifications_url":"https://api.github.com/repos/artygus/scheduler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/artygus/scheduler/labels{/name}","releases_url":"https://api.github.com/repos/artygus/scheduler/releases{/id}","deployments_url":"https://api.github.com/repos/artygus/scheduler/deployments","created_at":"2018-02-23T10:21:29Z","updated_at":"2018-02-23T10:28:03Z","pushed_at":"2018-02-23T13:00:21Z","git_url":"git://github.com/artygus/scheduler.git","ssh_url":"git@github.com:artygus/scheduler.git","clone_url":"https://github.com/artygus/scheduler.git","svn_url":"https://github.com/artygus/scheduler","homepage":null,"size":27,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"artygus:master","ref":"master","sha":"ab0a78d162680536d49888af818bb2547d929a9c","user":{"login":"artygus","id":4974968,"avatar_url":"https://avatars3.githubusercontent.com/u/4974968?v=4","gravatar_id":"","url":"https://api.github.com/users/artygus","html_url":"https://github.com/artygus","followers_url":"https://api.github.com/users/artygus/followers","following_url":"https://api.github.com/users/artygus/following{/other_user}","gists_url":"https://api.github.com/users/artygus/gists{/gist_id}","starred_url":"https://api.github.com/users/artygus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artygus/subscriptions","organizations_url":"https://api.github.com/users/artygus/orgs","repos_url":"https://api.github.com/users/artygus/repos","events_url":"https://api.github.com/users/artygus/events{/privacy}","received_events_url":"https://api.github.com/users/artygus/received_events","type":"User","site_admin":false},"repo":{"id":122606364,"name":"scheduler","full_name":"artygus/scheduler","owner":{"login":"artygus","id":4974968,"avatar_url":"https://avatars3.githubusercontent.com/u/4974968?v=4","gravatar_id":"","url":"https://api.github.com/users/artygus","html_url":"https://github.com/artygus","followers_url":"https://api.github.com/users/artygus/followers","following_url":"https://api.github.com/users/artygus/following{/other_user}","gists_url":"https://api.github.com/users/artygus/gists{/gist_id}","starred_url":"https://api.github.com/users/artygus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artygus/subscriptions","organizations_url":"https://api.github.com/users/artygus/orgs","repos_url":"https://api.github.com/users/artygus/repos","events_url":"https://api.github.com/users/artygus/events{/privacy}","received_events_url":"https://api.github.com/users/artygus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/artygus/scheduler","description":null,"fork":false,"url":"https://api.github.com/repos/artygus/scheduler","forks_url":"https://api.github.com/repos/artygus/scheduler/forks","keys_url":"https://api.github.com/repos/artygus/scheduler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/artygus/scheduler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/artygus/scheduler/teams","hooks_url":"https://api.github.com/repos/artygus/scheduler/hooks","issue_events_url":"https://api.github.com/repos/artygus/scheduler/issues/events{/number}","events_url":"https://api.github.com/repos/artygus/scheduler/events","assignees_url":"https://api.github.com/repos/artygus/scheduler/assignees{/user}","branches_url":"https://api.github.com/repos/artygus/scheduler/branches{/branch}","tags_url":"https://api.github.com/repos/artygus/scheduler/tags","blobs_url":"https://api.github.com/repos/artygus/scheduler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/artygus/scheduler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/artygus/scheduler/git/refs{/sha}","trees_url":"https://api.github.com/repos/artygus/scheduler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/artygus/scheduler/statuses/{sha}","languages_url":"https://api.github.com/repos/artygus/scheduler/languages","stargazers_url":"https://api.github.com/repos/artygus/scheduler/stargazers","contributors_url":"https://api.github.com/repos/artygus/scheduler/contributors","subscribers_url":"https://api.github.com/repos/artygus/scheduler/subscribers","subscription_url":"https://api.github.com/repos/artygus/scheduler/subscription","commits_url":"https://api.github.com/repos/artygus/scheduler/commits{/sha}","git_commits_url":"https://api.github.com/repos/artygus/scheduler/git/commits{/sha}","comments_url":"https://api.github.com/repos/artygus/scheduler/comments{/number}","issue_comment_url":"https://api.github.com/repos/artygus/scheduler/issues/comments{/number}","contents_url":"https://api.github.com/repos/artygus/scheduler/contents/{+path}","compare_url":"https://api.github.com/repos/artygus/scheduler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/artygus/scheduler/merges","archive_url":"https://api.github.com/repos/artygus/scheduler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/artygus/scheduler/downloads","issues_url":"https://api.github.com/repos/artygus/scheduler/issues{/number}","pulls_url":"https://api.github.com/repos/artygus/scheduler/pulls{/number}","milestones_url":"https://api.github.com/repos/artygus/scheduler/milestones{/number}","notifications_url":"https://api.github.com/repos/artygus/scheduler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/artygus/scheduler/labels{/name}","releases_url":"https://api.github.com/repos/artygus/scheduler/releases{/id}","deployments_url":"https://api.github.com/repos/artygus/scheduler/deployments","created_at":"2018-02-23T10:21:29Z","updated_at":"2018-02-23T10:28:03Z","pushed_at":"2018-02-23T13:00:21Z","git_url":"git://github.com/artygus/scheduler.git","ssh_url":"git@github.com:artygus/scheduler.git","clone_url":"https://github.com/artygus/scheduler.git","svn_url":"https://github.com/artygus/scheduler","homepage":null,"size":27,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/artygus/scheduler/pulls/2"},"html":{"href":"https://github.com/artygus/scheduler/pull/2"},"issue":{"href":"https://api.github.com/repos/artygus/scheduler/issues/2"},"comments":{"href":"https://api.github.com/repos/artygus/scheduler/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/artygus/scheduler/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/artygus/scheduler/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/artygus/scheduler/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/artygus/scheduler/statuses/6ca96cfe921e8285271b3097f53bd519d61bb992"}},"author_association":"OWNER"}}
{"actor":{"display_login":"ce07c3"}}