{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/kue/issues/787","repository_url":"https://api.github.com/repos/Automattic/kue","labels_url":"https://api.github.com/repos/Automattic/kue/issues/787/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/kue/issues/787/comments","events_url":"https://api.github.com/repos/Automattic/kue/issues/787/events","html_url":"https://github.com/Automattic/kue/issues/787","id":123880425,"node_id":"MDU6SXNzdWUxMjM4ODA0MjU=","number":787,"title":"use Promises for tasks","user":{"login":"indeyets","id":13445,"node_id":"MDQ6VXNlcjEzNDQ1","avatar_url":"https://avatars3.githubusercontent.com/u/13445?v=4","gravatar_id":"","url":"https://api.github.com/users/indeyets","html_url":"https://github.com/indeyets","followers_url":"https://api.github.com/users/indeyets/followers","following_url":"https://api.github.com/users/indeyets/following{/other_user}","gists_url":"https://api.github.com/users/indeyets/gists{/gist_id}","starred_url":"https://api.github.com/users/indeyets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indeyets/subscriptions","organizations_url":"https://api.github.com/users/indeyets/orgs","repos_url":"https://api.github.com/users/indeyets/repos","events_url":"https://api.github.com/users/indeyets/events{/privacy}","received_events_url":"https://api.github.com/users/indeyets/received_events","type":"User","site_admin":false},"labels":[{"id":133324550,"node_id":"MDU6TGFiZWwxMzMzMjQ1NTA=","url":"https://api.github.com/repos/Automattic/kue/labels/Discussion","name":"Discussion","color":"bfd4f2","default":false},{"id":128165,"node_id":"MDU6TGFiZWwxMjgxNjU=","url":"https://api.github.com/repos/Automattic/kue/labels/Feature","name":"Feature","color":"009800","default":false},{"id":128164,"node_id":"MDU6TGFiZWwxMjgxNjQ=","url":"https://api.github.com/repos/Automattic/kue/labels/Optimization","name":"Optimization","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2015-12-25T13:00:58Z","updated_at":"2019-01-05T14:40:33Z","closed_at":null,"author_association":"NONE","body":"We're writing majority of code using async/await these days. So our first thought was to use it for kue-tasks too. Something like this:\n\n``` js\nqueue.process('hello', async (job) => {\n  let tmpResult = await someLongBoringOperation(job.data.name);\n  await otherLongOperation(tmpResult, job.data.planet);\n});\n```\n\nThat doesn't work as kue doesn't distinguish promises from regular functions. Workarounds are mentioned in Readme, but they hurt elegance of app code.\n\nIs there a chance that kue will have \"native\" support for promises?\n\nThe only complication I see is optional `workerCtx` param. Otherwise, the code should be trivial\n"},"comment":{"url":"https://api.github.com/repos/Automattic/kue/issues/comments/451661132","html_url":"https://github.com/Automattic/kue/issues/787#issuecomment-451661132","issue_url":"https://api.github.com/repos/Automattic/kue/issues/787","id":451661132,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTY2MTEzMg==","user":{"login":"notflip","id":4146384,"node_id":"MDQ6VXNlcjQxNDYzODQ=","avatar_url":"https://avatars0.githubusercontent.com/u/4146384?v=4","gravatar_id":"","url":"https://api.github.com/users/notflip","html_url":"https://github.com/notflip","followers_url":"https://api.github.com/users/notflip/followers","following_url":"https://api.github.com/users/notflip/following{/other_user}","gists_url":"https://api.github.com/users/notflip/gists{/gist_id}","starred_url":"https://api.github.com/users/notflip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notflip/subscriptions","organizations_url":"https://api.github.com/users/notflip/orgs","repos_url":"https://api.github.com/users/notflip/repos","events_url":"https://api.github.com/users/notflip/events{/privacy}","received_events_url":"https://api.github.com/users/notflip/received_events","type":"User","site_admin":false},"created_at":"2019-01-05T14:40:32Z","updated_at":"2019-01-05T14:40:32Z","author_association":"NONE","body":"Can someone explain what the above method does?"}}
{"actor":{"display_login":"notflip"}}