{"action":"closed","number":9,"pull_request":{"url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/pulls/9","id":234961724,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0OTYxNzI0","html_url":"https://github.com/bitfinexcom/bfx-wrk-api/pull/9","diff_url":"https://github.com/bitfinexcom/bfx-wrk-api/pull/9.diff","patch_url":"https://github.com/bitfinexcom/bfx-wrk-api/pull/9.patch","issue_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/issues/9","number":9,"state":"closed","locked":false,"title":"Add async functions support","user":{"login":"ZIMkaRU","id":16489235,"node_id":"MDQ6VXNlcjE2NDg5MjM1","avatar_url":"https://avatars2.githubusercontent.com/u/16489235?v=4","gravatar_id":"","url":"https://api.github.com/users/ZIMkaRU","html_url":"https://github.com/ZIMkaRU","followers_url":"https://api.github.com/users/ZIMkaRU/followers","following_url":"https://api.github.com/users/ZIMkaRU/following{/other_user}","gists_url":"https://api.github.com/users/ZIMkaRU/gists{/gist_id}","starred_url":"https://api.github.com/users/ZIMkaRU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZIMkaRU/subscriptions","organizations_url":"https://api.github.com/users/ZIMkaRU/orgs","repos_url":"https://api.github.com/users/ZIMkaRU/repos","events_url":"https://api.github.com/users/ZIMkaRU/events{/privacy}","received_events_url":"https://api.github.com/users/ZIMkaRU/received_events","type":"User","site_admin":false},"body":"This adds async functions support  to get free of the callback and just return the result, and callback support is remained\r\n\r\nFor example:\r\ninstead\r\n```\r\n  async enableScheduler (space, args, cb) {\r\n    try {\r\n      await this.dao.checkAuthInDb(args)\r\n      await this.dao.updateStateOf('scheduler', true)\r\n      const res = await this.syncNow()\r\n\r\n      if (!cb) return res\r\n      cb(null, res)\r\n    } catch (err) {\r\n      if (!cb) throw err\r\n      cb(err)\r\n    }\r\n  }\r\n```\r\nto do this\r\n```\r\n  async enableScheduler (space, args) {\r\n    await this.dao.checkAuthInDb(args)\r\n    await this.dao.updateStateOf('scheduler', true)\r\n    const res = await this.syncNow()\r\n\r\n    return res\r\n  }\r\n```","created_at":"2018-11-30T11:46:51Z","updated_at":"2018-12-05T16:08:43Z","closed_at":"2018-12-05T16:08:42Z","merged_at":"2018-12-05T16:08:42Z","merge_commit_sha":"4186813dd0f46cfd605836dae7866cca0fef5572","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/pulls/9/commits","review_comments_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/pulls/9/comments","review_comment_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/issues/9/comments","statuses_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/statuses/ed5c7b8646b488256c2e4c74f9d24210ce98a1bc","head":{"label":"ZIMkaRU:master","ref":"master","sha":"ed5c7b8646b488256c2e4c74f9d24210ce98a1bc","user":{"login":"ZIMkaRU","id":16489235,"node_id":"MDQ6VXNlcjE2NDg5MjM1","avatar_url":"https://avatars2.githubusercontent.com/u/16489235?v=4","gravatar_id":"","url":"https://api.github.com/users/ZIMkaRU","html_url":"https://github.com/ZIMkaRU","followers_url":"https://api.github.com/users/ZIMkaRU/followers","following_url":"https://api.github.com/users/ZIMkaRU/following{/other_user}","gists_url":"https://api.github.com/users/ZIMkaRU/gists{/gist_id}","starred_url":"https://api.github.com/users/ZIMkaRU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZIMkaRU/subscriptions","organizations_url":"https://api.github.com/users/ZIMkaRU/orgs","repos_url":"https://api.github.com/users/ZIMkaRU/repos","events_url":"https://api.github.com/users/ZIMkaRU/events{/privacy}","received_events_url":"https://api.github.com/users/ZIMkaRU/received_events","type":"User","site_admin":false},"repo":{"id":159807956,"node_id":"MDEwOlJlcG9zaXRvcnkxNTk4MDc5NTY=","name":"bfx-wrk-api","full_name":"ZIMkaRU/bfx-wrk-api","private":false,"owner":{"login":"ZIMkaRU","id":16489235,"node_id":"MDQ6VXNlcjE2NDg5MjM1","avatar_url":"https://avatars2.githubusercontent.com/u/16489235?v=4","gravatar_id":"","url":"https://api.github.com/users/ZIMkaRU","html_url":"https://github.com/ZIMkaRU","followers_url":"https://api.github.com/users/ZIMkaRU/followers","following_url":"https://api.github.com/users/ZIMkaRU/following{/other_user}","gists_url":"https://api.github.com/users/ZIMkaRU/gists{/gist_id}","starred_url":"https://api.github.com/users/ZIMkaRU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZIMkaRU/subscriptions","organizations_url":"https://api.github.com/users/ZIMkaRU/orgs","repos_url":"https://api.github.com/users/ZIMkaRU/repos","events_url":"https://api.github.com/users/ZIMkaRU/events{/privacy}","received_events_url":"https://api.github.com/users/ZIMkaRU/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ZIMkaRU/bfx-wrk-api","description":null,"fork":true,"url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api","forks_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/forks","keys_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/teams","hooks_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/hooks","issue_events_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/issues/events{/number}","events_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/events","assignees_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/assignees{/user}","branches_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/branches{/branch}","tags_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/tags","blobs_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/statuses/{sha}","languages_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/languages","stargazers_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/stargazers","contributors_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/contributors","subscribers_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/subscribers","subscription_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/subscription","commits_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/contents/{+path}","compare_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/merges","archive_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/downloads","issues_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/issues{/number}","pulls_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/pulls{/number}","milestones_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/milestones{/number}","notifications_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/labels{/name}","releases_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/releases{/id}","deployments_url":"https://api.github.com/repos/ZIMkaRU/bfx-wrk-api/deployments","created_at":"2018-11-30T10:33:52Z","updated_at":"2018-11-30T10:42:39Z","pushed_at":"2018-11-30T10:42:37Z","git_url":"git://github.com/ZIMkaRU/bfx-wrk-api.git","ssh_url":"git@github.com:ZIMkaRU/bfx-wrk-api.git","clone_url":"https://github.com/ZIMkaRU/bfx-wrk-api.git","svn_url":"https://github.com/ZIMkaRU/bfx-wrk-api","homepage":null,"size":17,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bitfinexcom:master","ref":"master","sha":"de205cf92bac5941a0ad1e7709fb7702741b4559","user":{"login":"bitfinexcom","id":12942297,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyOTQyMjk3","avatar_url":"https://avatars0.githubusercontent.com/u/12942297?v=4","gravatar_id":"","url":"https://api.github.com/users/bitfinexcom","html_url":"https://github.com/bitfinexcom","followers_url":"https://api.github.com/users/bitfinexcom/followers","following_url":"https://api.github.com/users/bitfinexcom/following{/other_user}","gists_url":"https://api.github.com/users/bitfinexcom/gists{/gist_id}","starred_url":"https://api.github.com/users/bitfinexcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitfinexcom/subscriptions","organizations_url":"https://api.github.com/users/bitfinexcom/orgs","repos_url":"https://api.github.com/users/bitfinexcom/repos","events_url":"https://api.github.com/users/bitfinexcom/events{/privacy}","received_events_url":"https://api.github.com/users/bitfinexcom/received_events","type":"Organization","site_admin":false},"repo":{"id":105545138,"node_id":"MDEwOlJlcG9zaXRvcnkxMDU1NDUxMzg=","name":"bfx-wrk-api","full_name":"bitfinexcom/bfx-wrk-api","private":false,"owner":{"login":"bitfinexcom","id":12942297,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyOTQyMjk3","avatar_url":"https://avatars0.githubusercontent.com/u/12942297?v=4","gravatar_id":"","url":"https://api.github.com/users/bitfinexcom","html_url":"https://github.com/bitfinexcom","followers_url":"https://api.github.com/users/bitfinexcom/followers","following_url":"https://api.github.com/users/bitfinexcom/following{/other_user}","gists_url":"https://api.github.com/users/bitfinexcom/gists{/gist_id}","starred_url":"https://api.github.com/users/bitfinexcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitfinexcom/subscriptions","organizations_url":"https://api.github.com/users/bitfinexcom/orgs","repos_url":"https://api.github.com/users/bitfinexcom/repos","events_url":"https://api.github.com/users/bitfinexcom/events{/privacy}","received_events_url":"https://api.github.com/users/bitfinexcom/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/bitfinexcom/bfx-wrk-api","description":null,"fork":false,"url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api","forks_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/forks","keys_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/teams","hooks_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/hooks","issue_events_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/issues/events{/number}","events_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/events","assignees_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/assignees{/user}","branches_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/branches{/branch}","tags_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/tags","blobs_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/statuses/{sha}","languages_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/languages","stargazers_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/stargazers","contributors_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/contributors","subscribers_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/subscribers","subscription_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/subscription","commits_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/contents/{+path}","compare_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/merges","archive_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/downloads","issues_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/issues{/number}","pulls_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/pulls{/number}","milestones_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/milestones{/number}","notifications_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/labels{/name}","releases_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/releases{/id}","deployments_url":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/deployments","created_at":"2017-10-02T14:36:22Z","updated_at":"2018-10-18T07:46:11Z","pushed_at":"2018-12-05T16:08:42Z","git_url":"git://github.com/bitfinexcom/bfx-wrk-api.git","ssh_url":"git@github.com:bitfinexcom/bfx-wrk-api.git","clone_url":"https://github.com/bitfinexcom/bfx-wrk-api.git","svn_url":"https://github.com/bitfinexcom/bfx-wrk-api","homepage":null,"size":17,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":3,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/pulls/9"},"html":{"href":"https://github.com/bitfinexcom/bfx-wrk-api/pull/9"},"issue":{"href":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/issues/9"},"comments":{"href":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/bitfinexcom/bfx-wrk-api/statuses/ed5c7b8646b488256c2e4c74f9d24210ce98a1bc"}},"author_association":"NONE","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"prdn","id":3747053,"node_id":"MDQ6VXNlcjM3NDcwNTM=","avatar_url":"https://avatars1.githubusercontent.com/u/3747053?v=4","gravatar_id":"","url":"https://api.github.com/users/prdn","html_url":"https://github.com/prdn","followers_url":"https://api.github.com/users/prdn/followers","following_url":"https://api.github.com/users/prdn/following{/other_user}","gists_url":"https://api.github.com/users/prdn/gists{/gist_id}","starred_url":"https://api.github.com/users/prdn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prdn/subscriptions","organizations_url":"https://api.github.com/users/prdn/orgs","repos_url":"https://api.github.com/users/prdn/repos","events_url":"https://api.github.com/users/prdn/events{/privacy}","received_events_url":"https://api.github.com/users/prdn/received_events","type":"User","site_admin":false},"comments":0,"review_comments":1,"maintainer_can_modify":false,"commits":1,"additions":9,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"prdn"}}