{"action":"created","comment":{"url":"https://api.github.com/repos/taskrabbit/node-resquebus/pulls/comments/26716254","id":26716254,"diff_hunk":"@@ -1,79 +1,62 @@\n var utils = require(__dirname + '/utils.js');\n var uuid  = require('node-uuid');\n var os    = require('os');\n-// var i18n  = require('i18n');\n-// var time  = require('time');\n \n var publish = function(eventType, args, callback){\n   var self = this;\n   var queue = self.options.incommigQueue;\n-  var klass = self.options.busDriverClassKey;\n-\n-  payload = [publishMetadata(eventType, args)];\n+  var klass = self.options.busClassKey;\n+  var payload = [publishMetadata(eventType, args)];\n+  payload[0].bus_class_proxy  = '::QueueBus::Driver';\n \n   self.queueObject.enqueue(queue, klass, payload, function(err, toRun){\n     if(typeof callback === 'function'){ callback(err, toRun); }\n   });\n-}\n+};\n \n var publishAt = function(timestamp, eventType, args, callback){\n-  var self = this;\n-  var queue = self.options.incommigQueue;\n-  var klass = self.options.busPublisherClassKey;\n-\n-  payload = [publishMetadata(eventType, args)];\n-  if(payload[\"bus_delayed_until\"] == null){\n-    payload[\"bus_delayed_until\"] = Math.floor(timestamp/1000);\n+  var self    = this;\n+  var queue   = self.options.incommigQueue;\n+  var klass   = self.options.busClassKey;\n+  var payload = [publishMetadata(eventType, args)];\n+  payload[0].bus_class_proxy  = '::QueueBus::Publisher';\n+\n+  if(payload.bus_delayed_until === undefined){\n+    payload.bus_delayed_until = Math.floor(timestamp/1000);\n   }\n-  delete payload['bus_published_at']; // will get re-added upon re-publish\n \n-  self.queueObject.enqueueAt(timestamp, queue, klass, payload, function(){\n-    if(typeof callback === 'function'){ callback(); }\n+  delete payload.bus_published_at; // will get re-added upon re-publish\n+\n+  self.queueObject.enqueueAt(timestamp, queue, klass, payload, function(err){\n+    if(typeof callback === 'function'){ callback(err); }\n   });\n-}\n+};\n \n var publishIn = function(time, eventType, args, callback){\n   var self = this;\n   var timestamp = new Date().getTime() + time;\n   self.publishAt(timestamp, eventType, args, callback);\n-}\n+};\n \n var publishMetadata = function(eventType, args){\n   var payload = {};\n-  if(eventType != null){\n-    payload['bus_event_type'] = eventType\n+  if(eventType){\n+    payload.bus_event_type = eventType;\n   } else {\n-    payload['bus_event_type'] = null;\n+    payload.bus_event_type = null;\n   }\n-  payload['bus_created_at']   = utils.timestamp(); // TODO: get this back in ruby resque-bus\n-  payload['bus_published_at'] = utils.timestamp();\n-  payload['bus_id']           = utils.timestamp() + \"-\" + uuid.v4();\n-  payload['bus_app_hostname'] = os.hostname();\n-  // payload['bus_locale']       = i18n.getLocale();\n-  // payload['bus_timezone']     = time.currentTimezone; \n+  payload.bus_created_at   = utils.timestamp(); // TODO: get this back in ruby resque-bus\n+  payload.bus_published_at = utils.timestamp();\n+  payload.bus_id           = utils.timestamp() + \"-\" + uuid.v4();\n+  payload.bus_app_hostname = os.hostname();","path":"lib/sections/publish.js","position":78,"original_position":78,"commit_id":"6cd7f2904c8f643c09ea02f2a9c12e8250ac581c","original_commit_id":"6cd7f2904c8f643c09ea02f2a9c12e8250ac581c","user":{"login":"bleonard","id":36106,"avatar_url":"https://avatars.githubusercontent.com/u/36106?v=3","gravatar_id":"","url":"https://api.github.com/users/bleonard","html_url":"https://github.com/bleonard","followers_url":"https://api.github.com/users/bleonard/followers","following_url":"https://api.github.com/users/bleonard/following{/other_user}","gists_url":"https://api.github.com/users/bleonard/gists{/gist_id}","starred_url":"https://api.github.com/users/bleonard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bleonard/subscriptions","organizations_url":"https://api.github.com/users/bleonard/orgs","repos_url":"https://api.github.com/users/bleonard/repos","events_url":"https://api.github.com/users/bleonard/events{/privacy}","received_events_url":"https://api.github.com/users/bleonard/received_events","type":"User","site_admin":false},"body":"here are the fields\r\nhttps://github.com/queue-bus/queue-bus/blob/f5822ce1da81fd4cae4191c59726cbcd7cbd702d/lib/queue_bus/publishing.rb#L24\r\n\r\nbus_published_at\r\nbus_event_type\r\nbus_id\r\nbus_app_hostname\r\nbus_locale\r\nbus_timezone","created_at":"2015-03-18T22:58:26Z","updated_at":"2015-03-18T22:58:26Z","html_url":"https://github.com/taskrabbit/node-resquebus/pull/1#discussion_r26716254","pull_request_url":"https://api.github.com/repos/taskrabbit/node-resquebus/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/taskrabbit/node-resquebus/pulls/comments/26716254"},"html":{"href":"https://github.com/taskrabbit/node-resquebus/pull/1#discussion_r26716254"},"pull_request":{"href":"https://api.github.com/repos/taskrabbit/node-resquebus/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/taskrabbit/node-resquebus/pulls/1","id":31441154,"html_url":"https://github.com/taskrabbit/node-resquebus/pull/1","diff_url":"https://github.com/taskrabbit/node-resquebus/pull/1.diff","patch_url":"https://github.com/taskrabbit/node-resquebus/pull/1.patch","issue_url":"https://api.github.com/repos/taskrabbit/node-resquebus/issues/1","number":1,"state":"open","locked":false,"title":"[HOLD] New bus","user":{"login":"evantahler","id":303226,"avatar_url":"https://avatars.githubusercontent.com/u/303226?v=3","gravatar_id":"","url":"https://api.github.com/users/evantahler","html_url":"https://github.com/evantahler","followers_url":"https://api.github.com/users/evantahler/followers","following_url":"https://api.github.com/users/evantahler/following{/other_user}","gists_url":"https://api.github.com/users/evantahler/gists{/gist_id}","starred_url":"https://api.github.com/users/evantahler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evantahler/subscriptions","organizations_url":"https://api.github.com/users/evantahler/orgs","repos_url":"https://api.github.com/users/evantahler/repos","events_url":"https://api.github.com/users/evantahler/events{/privacy}","received_events_url":"https://api.github.com/users/evantahler/received_events","type":"User","site_admin":false},"body":"Notes: \r\n\r\n- This version does not need to be able to work old driver events (we don't need to be that interoperable) ","created_at":"2015-03-18T15:41:03Z","updated_at":"2015-03-18T22:58:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7553f012d3a42e4e492ab1cd9be05a8147a8ac6f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/taskrabbit/node-resquebus/pulls/1/commits","review_comments_url":"https://api.github.com/repos/taskrabbit/node-resquebus/pulls/1/comments","review_comment_url":"https://api.github.com/repos/taskrabbit/node-resquebus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/taskrabbit/node-resquebus/issues/1/comments","statuses_url":"https://api.github.com/repos/taskrabbit/node-resquebus/statuses/6cd7f2904c8f643c09ea02f2a9c12e8250ac581c","head":{"label":"taskrabbit:new_bus","ref":"new_bus","sha":"6cd7f2904c8f643c09ea02f2a9c12e8250ac581c","user":{"login":"taskrabbit","id":666590,"avatar_url":"https://avatars.githubusercontent.com/u/666590?v=3","gravatar_id":"","url":"https://api.github.com/users/taskrabbit","html_url":"https://github.com/taskrabbit","followers_url":"https://api.github.com/users/taskrabbit/followers","following_url":"https://api.github.com/users/taskrabbit/following{/other_user}","gists_url":"https://api.github.com/users/taskrabbit/gists{/gist_id}","starred_url":"https://api.github.com/users/taskrabbit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskrabbit/subscriptions","organizations_url":"https://api.github.com/users/taskrabbit/orgs","repos_url":"https://api.github.com/users/taskrabbit/repos","events_url":"https://api.github.com/users/taskrabbit/events{/privacy}","received_events_url":"https://api.github.com/users/taskrabbit/received_events","type":"Organization","site_admin":false},"repo":{"id":15484039,"name":"node-resquebus","full_name":"taskrabbit/node-resquebus","owner":{"login":"taskrabbit","id":666590,"avatar_url":"https://avatars.githubusercontent.com/u/666590?v=3","gravatar_id":"","url":"https://api.github.com/users/taskrabbit","html_url":"https://github.com/taskrabbit","followers_url":"https://api.github.com/users/taskrabbit/followers","following_url":"https://api.github.com/users/taskrabbit/following{/other_user}","gists_url":"https://api.github.com/users/taskrabbit/gists{/gist_id}","starred_url":"https://api.github.com/users/taskrabbit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskrabbit/subscriptions","organizations_url":"https://api.github.com/users/taskrabbit/orgs","repos_url":"https://api.github.com/users/taskrabbit/repos","events_url":"https://api.github.com/users/taskrabbit/events{/privacy}","received_events_url":"https://api.github.com/users/taskrabbit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/taskrabbit/node-resquebus","description":"It's ResqueBus... in Node!","fork":false,"url":"https://api.github.com/repos/taskrabbit/node-resquebus","forks_url":"https://api.github.com/repos/taskrabbit/node-resquebus/forks","keys_url":"https://api.github.com/repos/taskrabbit/node-resquebus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taskrabbit/node-resquebus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taskrabbit/node-resquebus/teams","hooks_url":"https://api.github.com/repos/taskrabbit/node-resquebus/hooks","issue_events_url":"https://api.github.com/repos/taskrabbit/node-resquebus/issues/events{/number}","events_url":"https://api.github.com/repos/taskrabbit/node-resquebus/events","assignees_url":"https://api.github.com/repos/taskrabbit/node-resquebus/assignees{/user}","branches_url":"https://api.github.com/repos/taskrabbit/node-resquebus/branches{/branch}","tags_url":"https://api.github.com/repos/taskrabbit/node-resquebus/tags","blobs_url":"https://api.github.com/repos/taskrabbit/node-resquebus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taskrabbit/node-resquebus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taskrabbit/node-resquebus/git/refs{/sha}","trees_url":"https://api.github.com/repos/taskrabbit/node-resquebus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taskrabbit/node-resquebus/statuses/{sha}","languages_url":"https://api.github.com/repos/taskrabbit/node-resquebus/languages","stargazers_url":"https://api.github.com/repos/taskrabbit/node-resquebus/stargazers","contributors_url":"https://api.github.com/repos/taskrabbit/node-resquebus/contributors","subscribers_url":"https://api.github.com/repos/taskrabbit/node-resquebus/subscribers","subscription_url":"https://api.github.com/repos/taskrabbit/node-resquebus/subscription","commits_url":"https://api.github.com/repos/taskrabbit/node-resquebus/commits{/sha}","git_commits_url":"https://api.github.com/repos/taskrabbit/node-resquebus/git/commits{/sha}","comments_url":"https://api.github.com/repos/taskrabbit/node-resquebus/comments{/number}","issue_comment_url":"https://api.github.com/repos/taskrabbit/node-resquebus/issues/comments{/number}","contents_url":"https://api.github.com/repos/taskrabbit/node-resquebus/contents/{+path}","compare_url":"https://api.github.com/repos/taskrabbit/node-resquebus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taskrabbit/node-resquebus/merges","archive_url":"https://api.github.com/repos/taskrabbit/node-resquebus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taskrabbit/node-resquebus/downloads","issues_url":"https://api.github.com/repos/taskrabbit/node-resquebus/issues{/number}","pulls_url":"https://api.github.com/repos/taskrabbit/node-resquebus/pulls{/number}","milestones_url":"https://api.github.com/repos/taskrabbit/node-resquebus/milestones{/number}","notifications_url":"https://api.github.com/repos/taskrabbit/node-resquebus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taskrabbit/node-resquebus/labels{/name}","releases_url":"https://api.github.com/repos/taskrabbit/node-resquebus/releases{/id}","created_at":"2013-12-27T23:49:49Z","updated_at":"2014-08-09T08:57:04Z","pushed_at":"2015-03-18T18:49:43Z","git_url":"git://github.com/taskrabbit/node-resquebus.git","ssh_url":"git@github.com:taskrabbit/node-resquebus.git","clone_url":"https://github.com/taskrabbit/node-resquebus.git","svn_url":"https://github.com/taskrabbit/node-resquebus","homepage":"","size":409,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"taskrabbit:master","ref":"master","sha":"f3f459c7ea97a18758cc8e0a88a8378206982322","user":{"login":"taskrabbit","id":666590,"avatar_url":"https://avatars.githubusercontent.com/u/666590?v=3","gravatar_id":"","url":"https://api.github.com/users/taskrabbit","html_url":"https://github.com/taskrabbit","followers_url":"https://api.github.com/users/taskrabbit/followers","following_url":"https://api.github.com/users/taskrabbit/following{/other_user}","gists_url":"https://api.github.com/users/taskrabbit/gists{/gist_id}","starred_url":"https://api.github.com/users/taskrabbit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskrabbit/subscriptions","organizations_url":"https://api.github.com/users/taskrabbit/orgs","repos_url":"https://api.github.com/users/taskrabbit/repos","events_url":"https://api.github.com/users/taskrabbit/events{/privacy}","received_events_url":"https://api.github.com/users/taskrabbit/received_events","type":"Organization","site_admin":false},"repo":{"id":15484039,"name":"node-resquebus","full_name":"taskrabbit/node-resquebus","owner":{"login":"taskrabbit","id":666590,"avatar_url":"https://avatars.githubusercontent.com/u/666590?v=3","gravatar_id":"","url":"https://api.github.com/users/taskrabbit","html_url":"https://github.com/taskrabbit","followers_url":"https://api.github.com/users/taskrabbit/followers","following_url":"https://api.github.com/users/taskrabbit/following{/other_user}","gists_url":"https://api.github.com/users/taskrabbit/gists{/gist_id}","starred_url":"https://api.github.com/users/taskrabbit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskrabbit/subscriptions","organizations_url":"https://api.github.com/users/taskrabbit/orgs","repos_url":"https://api.github.com/users/taskrabbit/repos","events_url":"https://api.github.com/users/taskrabbit/events{/privacy}","received_events_url":"https://api.github.com/users/taskrabbit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/taskrabbit/node-resquebus","description":"It's ResqueBus... in Node!","fork":false,"url":"https://api.github.com/repos/taskrabbit/node-resquebus","forks_url":"https://api.github.com/repos/taskrabbit/node-resquebus/forks","keys_url":"https://api.github.com/repos/taskrabbit/node-resquebus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taskrabbit/node-resquebus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taskrabbit/node-resquebus/teams","hooks_url":"https://api.github.com/repos/taskrabbit/node-resquebus/hooks","issue_events_url":"https://api.github.com/repos/taskrabbit/node-resquebus/issues/events{/number}","events_url":"https://api.github.com/repos/taskrabbit/node-resquebus/events","assignees_url":"https://api.github.com/repos/taskrabbit/node-resquebus/assignees{/user}","branches_url":"https://api.github.com/repos/taskrabbit/node-resquebus/branches{/branch}","tags_url":"https://api.github.com/repos/taskrabbit/node-resquebus/tags","blobs_url":"https://api.github.com/repos/taskrabbit/node-resquebus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taskrabbit/node-resquebus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taskrabbit/node-resquebus/git/refs{/sha}","trees_url":"https://api.github.com/repos/taskrabbit/node-resquebus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taskrabbit/node-resquebus/statuses/{sha}","languages_url":"https://api.github.com/repos/taskrabbit/node-resquebus/languages","stargazers_url":"https://api.github.com/repos/taskrabbit/node-resquebus/stargazers","contributors_url":"https://api.github.com/repos/taskrabbit/node-resquebus/contributors","subscribers_url":"https://api.github.com/repos/taskrabbit/node-resquebus/subscribers","subscription_url":"https://api.github.com/repos/taskrabbit/node-resquebus/subscription","commits_url":"https://api.github.com/repos/taskrabbit/node-resquebus/commits{/sha}","git_commits_url":"https://api.github.com/repos/taskrabbit/node-resquebus/git/commits{/sha}","comments_url":"https://api.github.com/repos/taskrabbit/node-resquebus/comments{/number}","issue_comment_url":"https://api.github.com/repos/taskrabbit/node-resquebus/issues/comments{/number}","contents_url":"https://api.github.com/repos/taskrabbit/node-resquebus/contents/{+path}","compare_url":"https://api.github.com/repos/taskrabbit/node-resquebus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taskrabbit/node-resquebus/merges","archive_url":"https://api.github.com/repos/taskrabbit/node-resquebus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taskrabbit/node-resquebus/downloads","issues_url":"https://api.github.com/repos/taskrabbit/node-resquebus/issues{/number}","pulls_url":"https://api.github.com/repos/taskrabbit/node-resquebus/pulls{/number}","milestones_url":"https://api.github.com/repos/taskrabbit/node-resquebus/milestones{/number}","notifications_url":"https://api.github.com/repos/taskrabbit/node-resquebus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taskrabbit/node-resquebus/labels{/name}","releases_url":"https://api.github.com/repos/taskrabbit/node-resquebus/releases{/id}","created_at":"2013-12-27T23:49:49Z","updated_at":"2014-08-09T08:57:04Z","pushed_at":"2015-03-18T18:49:43Z","git_url":"git://github.com/taskrabbit/node-resquebus.git","ssh_url":"git@github.com:taskrabbit/node-resquebus.git","clone_url":"https://github.com/taskrabbit/node-resquebus.git","svn_url":"https://github.com/taskrabbit/node-resquebus","homepage":"","size":409,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/taskrabbit/node-resquebus/pulls/1"},"html":{"href":"https://github.com/taskrabbit/node-resquebus/pull/1"},"issue":{"href":"https://api.github.com/repos/taskrabbit/node-resquebus/issues/1"},"comments":{"href":"https://api.github.com/repos/taskrabbit/node-resquebus/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/taskrabbit/node-resquebus/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/taskrabbit/node-resquebus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/taskrabbit/node-resquebus/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/taskrabbit/node-resquebus/statuses/6cd7f2904c8f643c09ea02f2a9c12e8250ac581c"}}}}