{"action":"created","issue":{"url":"https://api.github.com/repos/smrchy/rsmq/issues/40","repository_url":"https://api.github.com/repos/smrchy/rsmq","labels_url":"https://api.github.com/repos/smrchy/rsmq/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/smrchy/rsmq/issues/40/comments","events_url":"https://api.github.com/repos/smrchy/rsmq/issues/40/events","html_url":"https://github.com/smrchy/rsmq/issues/40","id":195989771,"number":40,"title":"Idea of an event like wrapper around receiveMessage ","user":{"login":"ImanMh","id":4482199,"avatar_url":"https://avatars.githubusercontent.com/u/4482199?v=3","gravatar_id":"","url":"https://api.github.com/users/ImanMh","html_url":"https://github.com/ImanMh","followers_url":"https://api.github.com/users/ImanMh/followers","following_url":"https://api.github.com/users/ImanMh/following{/other_user}","gists_url":"https://api.github.com/users/ImanMh/gists{/gist_id}","starred_url":"https://api.github.com/users/ImanMh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ImanMh/subscriptions","organizations_url":"https://api.github.com/users/ImanMh/orgs","repos_url":"https://api.github.com/users/ImanMh/repos","events_url":"https://api.github.com/users/ImanMh/events{/privacy}","received_events_url":"https://api.github.com/users/ImanMh/received_events","type":"User","site_admin":false},"labels":[{"id":41927777,"url":"https://api.github.com/repos/smrchy/rsmq/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":41927779,"url":"https://api.github.com/repos/smrchy/rsmq/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"mpneuried","id":300631,"avatar_url":"https://avatars.githubusercontent.com/u/300631?v=3","gravatar_id":"","url":"https://api.github.com/users/mpneuried","html_url":"https://github.com/mpneuried","followers_url":"https://api.github.com/users/mpneuried/followers","following_url":"https://api.github.com/users/mpneuried/following{/other_user}","gists_url":"https://api.github.com/users/mpneuried/gists{/gist_id}","starred_url":"https://api.github.com/users/mpneuried/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpneuried/subscriptions","organizations_url":"https://api.github.com/users/mpneuried/orgs","repos_url":"https://api.github.com/users/mpneuried/repos","events_url":"https://api.github.com/users/mpneuried/events{/privacy}","received_events_url":"https://api.github.com/users/mpneuried/received_events","type":"User","site_admin":false},"assignees":[{"login":"mpneuried","id":300631,"avatar_url":"https://avatars.githubusercontent.com/u/300631?v=3","gravatar_id":"","url":"https://api.github.com/users/mpneuried","html_url":"https://github.com/mpneuried","followers_url":"https://api.github.com/users/mpneuried/followers","following_url":"https://api.github.com/users/mpneuried/following{/other_user}","gists_url":"https://api.github.com/users/mpneuried/gists{/gist_id}","starred_url":"https://api.github.com/users/mpneuried/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpneuried/subscriptions","organizations_url":"https://api.github.com/users/mpneuried/orgs","repos_url":"https://api.github.com/users/mpneuried/repos","events_url":"https://api.github.com/users/mpneuried/events{/privacy}","received_events_url":"https://api.github.com/users/mpneuried/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2016-12-16T06:25:28Z","updated_at":"2016-12-16T19:32:51Z","closed_at":null,"body":"What do you think about an event wrapper around ```receiveMessage``` method? Then we can do something like this: \r\n```javascript\r\nRedisSMQ = require(\"rsmq\");\r\nrsmq = new RedisSMQ( {host: \"127.0.0.1\", port: 6379, ns: \"rsmq\"} );\r\n\r\nrsmq.createQueue({qname:\"myqueue\"}, function (err, resp) {\r\n  if (resp === 1) {\r\n    console.log(\"queue created\")\r\n  }\r\n});\r\n\r\nrsmq.onMessage({qname:\"myqueue\"}, function (err, resp) {\r\n  if (resp.id) {\r\n    console.log(\"Message received.\", resp)  \r\n  }\r\n  else {\r\n    console.log(\"No messages for me...\")\r\n  }\r\n});\r\n\r\nsetInterval(function () {\r\n  rsmq.sendMessage({qname:\"myqueue\", message:\"Hello World\"}, function (err, resp) {\r\n    if (resp) {\r\n      console.log(\"Message sent. ID:\", resp);\r\n    }\r\n  });\r\n}, 1000);\r\n```"},"comment":{"url":"https://api.github.com/repos/smrchy/rsmq/issues/comments/267677060","html_url":"https://github.com/smrchy/rsmq/issues/40#issuecomment-267677060","issue_url":"https://api.github.com/repos/smrchy/rsmq/issues/40","id":267677060,"user":{"login":"ImanMh","id":4482199,"avatar_url":"https://avatars.githubusercontent.com/u/4482199?v=3","gravatar_id":"","url":"https://api.github.com/users/ImanMh","html_url":"https://github.com/ImanMh","followers_url":"https://api.github.com/users/ImanMh/followers","following_url":"https://api.github.com/users/ImanMh/following{/other_user}","gists_url":"https://api.github.com/users/ImanMh/gists{/gist_id}","starred_url":"https://api.github.com/users/ImanMh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ImanMh/subscriptions","organizations_url":"https://api.github.com/users/ImanMh/orgs","repos_url":"https://api.github.com/users/ImanMh/repos","events_url":"https://api.github.com/users/ImanMh/events{/privacy}","received_events_url":"https://api.github.com/users/ImanMh/received_events","type":"User","site_admin":false},"created_at":"2016-12-16T19:32:51Z","updated_at":"2016-12-16T19:32:51Z","body":"ThanX"}}
{"actor":{"display_login":"ImanMh"}}