{"action":"created","comment":{"url":"https://api.github.com/repos/openwhisk/openwhisk/pulls/comments/58297327","id":58297327,"diff_hunk":"@@ -60,17 +77,22 @@ object WhiskServices extends LoadbalancerRequest {\n      * @return function that accepts an HttpRequest, posts request to load balancer\n      * and returns the HTTP response from the load balancer as a future\n      */\n-    def postLoadBalancerRequest(config: WhiskConfig, timeout: Timeout = 10 seconds)(\n-        implicit as: ActorSystem, ec: ExecutionContext): HttpRequest => Future[LoadBalancerResponse] =\n-        request(config.loadbalancerHost, timeout)\n+    def performLoadBalancerRequest(config: WhiskConfig, timeout: Timeout = 10 seconds)(\n+        implicit as: ActorSystem, ec: ExecutionContext): (String, ActivationMessage) => Future[LoadBalancerResponse] = {\n+        val requester = request(config.loadbalancerHost, timeout)\n+        (component: String, messages : ActivationMessage) => {\n+            val req = Post(component, messages.toJson.asJsObject)\n+            requester(req)\n+        }\n+    }\n }\n \n trait WhiskServices {\n     /** An entitlement service to check access rights. */\n     protected val entitlementService: EntitlementService\n \n-    /** An HTTP client to post backend requests via Whisk load balancer. */\n-    protected val postLoadBalancerRequest: HttpRequest => Future[LoadBalancerResponse]\n+    /** Synchronously perform a request to the load balancer.  */","path":"core/controller/src/whisk/core/controller/Backend.scala","position":49,"original_position":49,"commit_id":"522e8c13447af66a0dc2e659e10df9b7b6768bc7","original_commit_id":"522e8c13447af66a0dc2e659e10df9b7b6768bc7","user":{"login":"perryibm","id":14339749,"avatar_url":"https://avatars.githubusercontent.com/u/14339749?v=3","gravatar_id":"","url":"https://api.github.com/users/perryibm","html_url":"https://github.com/perryibm","followers_url":"https://api.github.com/users/perryibm/followers","following_url":"https://api.github.com/users/perryibm/following{/other_user}","gists_url":"https://api.github.com/users/perryibm/gists{/gist_id}","starred_url":"https://api.github.com/users/perryibm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/perryibm/subscriptions","organizations_url":"https://api.github.com/users/perryibm/orgs","repos_url":"https://api.github.com/users/perryibm/repos","events_url":"https://api.github.com/users/perryibm/events{/privacy}","received_events_url":"https://api.github.com/users/perryibm/received_events","type":"User","site_admin":false},"body":"Premature comment - it's not synchronous as of this commit yet since this is preparatory to the final piece.","created_at":"2016-04-02T18:07:35Z","updated_at":"2016-04-02T18:07:35Z","html_url":"https://github.com/openwhisk/openwhisk/pull/162#discussion_r58297327","pull_request_url":"https://api.github.com/repos/openwhisk/openwhisk/pulls/162","_links":{"self":{"href":"https://api.github.com/repos/openwhisk/openwhisk/pulls/comments/58297327"},"html":{"href":"https://github.com/openwhisk/openwhisk/pull/162#discussion_r58297327"},"pull_request":{"href":"https://api.github.com/repos/openwhisk/openwhisk/pulls/162"}}},"pull_request":{"url":"https://api.github.com/repos/openwhisk/openwhisk/pulls/162","id":65044857,"html_url":"https://github.com/openwhisk/openwhisk/pull/162","diff_url":"https://github.com/openwhisk/openwhisk/pull/162.diff","patch_url":"https://github.com/openwhisk/openwhisk/pull/162.patch","issue_url":"https://api.github.com/repos/openwhisk/openwhisk/issues/162","number":162,"state":"open","locked":false,"title":"WIP: Prepare load balancer merge","user":{"login":"perryibm","id":14339749,"avatar_url":"https://avatars.githubusercontent.com/u/14339749?v=3","gravatar_id":"","url":"https://api.github.com/users/perryibm","html_url":"https://github.com/perryibm","followers_url":"https://api.github.com/users/perryibm/followers","following_url":"https://api.github.com/users/perryibm/following{/other_user}","gists_url":"https://api.github.com/users/perryibm/gists{/gist_id}","starred_url":"https://api.github.com/users/perryibm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/perryibm/subscriptions","organizations_url":"https://api.github.com/users/perryibm/orgs","repos_url":"https://api.github.com/users/perryibm/repos","events_url":"https://api.github.com/users/perryibm/events{/privacy}","received_events_url":"https://api.github.com/users/perryibm/received_events","type":"User","site_admin":false},"body":"Not ready yet...\r\n\r\nThis is the final preparatory push before merging load balancer into the controller.  The two main parts are:\r\n\r\n1. Replace controller's http-centric postToLoadBalancer with a functional version by relegating http/rest and json-stuff to the lowest level.\r\n2. Invert the layering of functionality in the loadbalancer so that the bottom layer is NOT an http service but rather the core load balancer functionality.  By sinking consul and kafka aspects to the lower LoadBalancerService and lifting the http stuff into LoadBalancer, the LoadBalancerService can be the new entry point for the controller.\r\n\r\n","created_at":"2016-04-02T17:48:59Z","updated_at":"2016-04-02T18:07:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"567bf6f3e1907fc10a919a64b6692c4acd89e608","assignee":{"login":"rabbah","id":4959922,"avatar_url":"https://avatars.githubusercontent.com/u/4959922?v=3","gravatar_id":"","url":"https://api.github.com/users/rabbah","html_url":"https://github.com/rabbah","followers_url":"https://api.github.com/users/rabbah/followers","following_url":"https://api.github.com/users/rabbah/following{/other_user}","gists_url":"https://api.github.com/users/rabbah/gists{/gist_id}","starred_url":"https://api.github.com/users/rabbah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rabbah/subscriptions","organizations_url":"https://api.github.com/users/rabbah/orgs","repos_url":"https://api.github.com/users/rabbah/repos","events_url":"https://api.github.com/users/rabbah/events{/privacy}","received_events_url":"https://api.github.com/users/rabbah/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/openwhisk/openwhisk/pulls/162/commits","review_comments_url":"https://api.github.com/repos/openwhisk/openwhisk/pulls/162/comments","review_comment_url":"https://api.github.com/repos/openwhisk/openwhisk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openwhisk/openwhisk/issues/162/comments","statuses_url":"https://api.github.com/repos/openwhisk/openwhisk/statuses/522e8c13447af66a0dc2e659e10df9b7b6768bc7","head":{"label":"perryibm:prepareLoadBalancerMerge","ref":"prepareLoadBalancerMerge","sha":"522e8c13447af66a0dc2e659e10df9b7b6768bc7","user":{"login":"perryibm","id":14339749,"avatar_url":"https://avatars.githubusercontent.com/u/14339749?v=3","gravatar_id":"","url":"https://api.github.com/users/perryibm","html_url":"https://github.com/perryibm","followers_url":"https://api.github.com/users/perryibm/followers","following_url":"https://api.github.com/users/perryibm/following{/other_user}","gists_url":"https://api.github.com/users/perryibm/gists{/gist_id}","starred_url":"https://api.github.com/users/perryibm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/perryibm/subscriptions","organizations_url":"https://api.github.com/users/perryibm/orgs","repos_url":"https://api.github.com/users/perryibm/repos","events_url":"https://api.github.com/users/perryibm/events{/privacy}","received_events_url":"https://api.github.com/users/perryibm/received_events","type":"User","site_admin":false},"repo":{"id":52459267,"name":"openwhisk","full_name":"perryibm/openwhisk","owner":{"login":"perryibm","id":14339749,"avatar_url":"https://avatars.githubusercontent.com/u/14339749?v=3","gravatar_id":"","url":"https://api.github.com/users/perryibm","html_url":"https://github.com/perryibm","followers_url":"https://api.github.com/users/perryibm/followers","following_url":"https://api.github.com/users/perryibm/following{/other_user}","gists_url":"https://api.github.com/users/perryibm/gists{/gist_id}","starred_url":"https://api.github.com/users/perryibm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/perryibm/subscriptions","organizations_url":"https://api.github.com/users/perryibm/orgs","repos_url":"https://api.github.com/users/perryibm/repos","events_url":"https://api.github.com/users/perryibm/events{/privacy}","received_events_url":"https://api.github.com/users/perryibm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/perryibm/openwhisk","description":"OpenWhisk is a cloud-first distributed event-based programming service.","fork":true,"url":"https://api.github.com/repos/perryibm/openwhisk","forks_url":"https://api.github.com/repos/perryibm/openwhisk/forks","keys_url":"https://api.github.com/repos/perryibm/openwhisk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/perryibm/openwhisk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/perryibm/openwhisk/teams","hooks_url":"https://api.github.com/repos/perryibm/openwhisk/hooks","issue_events_url":"https://api.github.com/repos/perryibm/openwhisk/issues/events{/number}","events_url":"https://api.github.com/repos/perryibm/openwhisk/events","assignees_url":"https://api.github.com/repos/perryibm/openwhisk/assignees{/user}","branches_url":"https://api.github.com/repos/perryibm/openwhisk/branches{/branch}","tags_url":"https://api.github.com/repos/perryibm/openwhisk/tags","blobs_url":"https://api.github.com/repos/perryibm/openwhisk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/perryibm/openwhisk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/perryibm/openwhisk/git/refs{/sha}","trees_url":"https://api.github.com/repos/perryibm/openwhisk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/perryibm/openwhisk/statuses/{sha}","languages_url":"https://api.github.com/repos/perryibm/openwhisk/languages","stargazers_url":"https://api.github.com/repos/perryibm/openwhisk/stargazers","contributors_url":"https://api.github.com/repos/perryibm/openwhisk/contributors","subscribers_url":"https://api.github.com/repos/perryibm/openwhisk/subscribers","subscription_url":"https://api.github.com/repos/perryibm/openwhisk/subscription","commits_url":"https://api.github.com/repos/perryibm/openwhisk/commits{/sha}","git_commits_url":"https://api.github.com/repos/perryibm/openwhisk/git/commits{/sha}","comments_url":"https://api.github.com/repos/perryibm/openwhisk/comments{/number}","issue_comment_url":"https://api.github.com/repos/perryibm/openwhisk/issues/comments{/number}","contents_url":"https://api.github.com/repos/perryibm/openwhisk/contents/{+path}","compare_url":"https://api.github.com/repos/perryibm/openwhisk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/perryibm/openwhisk/merges","archive_url":"https://api.github.com/repos/perryibm/openwhisk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/perryibm/openwhisk/downloads","issues_url":"https://api.github.com/repos/perryibm/openwhisk/issues{/number}","pulls_url":"https://api.github.com/repos/perryibm/openwhisk/pulls{/number}","milestones_url":"https://api.github.com/repos/perryibm/openwhisk/milestones{/number}","notifications_url":"https://api.github.com/repos/perryibm/openwhisk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/perryibm/openwhisk/labels{/name}","releases_url":"https://api.github.com/repos/perryibm/openwhisk/releases{/id}","deployments_url":"https://api.github.com/repos/perryibm/openwhisk/deployments","created_at":"2016-02-24T17:00:55Z","updated_at":"2016-02-24T17:00:57Z","pushed_at":"2016-04-02T17:40:52Z","git_url":"git://github.com/perryibm/openwhisk.git","ssh_url":"git@github.com:perryibm/openwhisk.git","clone_url":"https://github.com/perryibm/openwhisk.git","svn_url":"https://github.com/perryibm/openwhisk","homepage":"","size":40410,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openwhisk:master","ref":"master","sha":"9e87bbfc0e9326aa13ab233400b4b860fa97d34a","user":{"login":"openwhisk","id":16900235,"avatar_url":"https://avatars.githubusercontent.com/u/16900235?v=3","gravatar_id":"","url":"https://api.github.com/users/openwhisk","html_url":"https://github.com/openwhisk","followers_url":"https://api.github.com/users/openwhisk/followers","following_url":"https://api.github.com/users/openwhisk/following{/other_user}","gists_url":"https://api.github.com/users/openwhisk/gists{/gist_id}","starred_url":"https://api.github.com/users/openwhisk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openwhisk/subscriptions","organizations_url":"https://api.github.com/users/openwhisk/orgs","repos_url":"https://api.github.com/users/openwhisk/repos","events_url":"https://api.github.com/users/openwhisk/events{/privacy}","received_events_url":"https://api.github.com/users/openwhisk/received_events","type":"Organization","site_admin":false},"repo":{"id":52039373,"name":"openwhisk","full_name":"openwhisk/openwhisk","owner":{"login":"openwhisk","id":16900235,"avatar_url":"https://avatars.githubusercontent.com/u/16900235?v=3","gravatar_id":"","url":"https://api.github.com/users/openwhisk","html_url":"https://github.com/openwhisk","followers_url":"https://api.github.com/users/openwhisk/followers","following_url":"https://api.github.com/users/openwhisk/following{/other_user}","gists_url":"https://api.github.com/users/openwhisk/gists{/gist_id}","starred_url":"https://api.github.com/users/openwhisk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openwhisk/subscriptions","organizations_url":"https://api.github.com/users/openwhisk/orgs","repos_url":"https://api.github.com/users/openwhisk/repos","events_url":"https://api.github.com/users/openwhisk/events{/privacy}","received_events_url":"https://api.github.com/users/openwhisk/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openwhisk/openwhisk","description":"OpenWhisk is a cloud-first distributed event-based programming service.","fork":false,"url":"https://api.github.com/repos/openwhisk/openwhisk","forks_url":"https://api.github.com/repos/openwhisk/openwhisk/forks","keys_url":"https://api.github.com/repos/openwhisk/openwhisk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openwhisk/openwhisk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openwhisk/openwhisk/teams","hooks_url":"https://api.github.com/repos/openwhisk/openwhisk/hooks","issue_events_url":"https://api.github.com/repos/openwhisk/openwhisk/issues/events{/number}","events_url":"https://api.github.com/repos/openwhisk/openwhisk/events","assignees_url":"https://api.github.com/repos/openwhisk/openwhisk/assignees{/user}","branches_url":"https://api.github.com/repos/openwhisk/openwhisk/branches{/branch}","tags_url":"https://api.github.com/repos/openwhisk/openwhisk/tags","blobs_url":"https://api.github.com/repos/openwhisk/openwhisk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openwhisk/openwhisk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openwhisk/openwhisk/git/refs{/sha}","trees_url":"https://api.github.com/repos/openwhisk/openwhisk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openwhisk/openwhisk/statuses/{sha}","languages_url":"https://api.github.com/repos/openwhisk/openwhisk/languages","stargazers_url":"https://api.github.com/repos/openwhisk/openwhisk/stargazers","contributors_url":"https://api.github.com/repos/openwhisk/openwhisk/contributors","subscribers_url":"https://api.github.com/repos/openwhisk/openwhisk/subscribers","subscription_url":"https://api.github.com/repos/openwhisk/openwhisk/subscription","commits_url":"https://api.github.com/repos/openwhisk/openwhisk/commits{/sha}","git_commits_url":"https://api.github.com/repos/openwhisk/openwhisk/git/commits{/sha}","comments_url":"https://api.github.com/repos/openwhisk/openwhisk/comments{/number}","issue_comment_url":"https://api.github.com/repos/openwhisk/openwhisk/issues/comments{/number}","contents_url":"https://api.github.com/repos/openwhisk/openwhisk/contents/{+path}","compare_url":"https://api.github.com/repos/openwhisk/openwhisk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openwhisk/openwhisk/merges","archive_url":"https://api.github.com/repos/openwhisk/openwhisk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openwhisk/openwhisk/downloads","issues_url":"https://api.github.com/repos/openwhisk/openwhisk/issues{/number}","pulls_url":"https://api.github.com/repos/openwhisk/openwhisk/pulls{/number}","milestones_url":"https://api.github.com/repos/openwhisk/openwhisk/milestones{/number}","notifications_url":"https://api.github.com/repos/openwhisk/openwhisk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openwhisk/openwhisk/labels{/name}","releases_url":"https://api.github.com/repos/openwhisk/openwhisk/releases{/id}","deployments_url":"https://api.github.com/repos/openwhisk/openwhisk/deployments","created_at":"2016-02-18T21:16:19Z","updated_at":"2016-04-02T04:20:48Z","pushed_at":"2016-04-02T17:49:00Z","git_url":"git://github.com/openwhisk/openwhisk.git","ssh_url":"git@github.com:openwhisk/openwhisk.git","clone_url":"https://github.com/openwhisk/openwhisk.git","svn_url":"https://github.com/openwhisk/openwhisk","homepage":"","size":40915,"stargazers_count":196,"watchers_count":196,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":56,"mirror_url":null,"open_issues_count":47,"forks":56,"open_issues":47,"watchers":196,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openwhisk/openwhisk/pulls/162"},"html":{"href":"https://github.com/openwhisk/openwhisk/pull/162"},"issue":{"href":"https://api.github.com/repos/openwhisk/openwhisk/issues/162"},"comments":{"href":"https://api.github.com/repos/openwhisk/openwhisk/issues/162/comments"},"review_comments":{"href":"https://api.github.com/repos/openwhisk/openwhisk/pulls/162/comments"},"review_comment":{"href":"https://api.github.com/repos/openwhisk/openwhisk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openwhisk/openwhisk/pulls/162/commits"},"statuses":{"href":"https://api.github.com/repos/openwhisk/openwhisk/statuses/522e8c13447af66a0dc2e659e10df9b7b6768bc7"}}}}