{"action":"created","comment":{"url":"https://api.github.com/repos/scootdev/scoot/pulls/comments/69595744","id":69595744,"diff_hunk":"@@ -0,0 +1,102 @@\n+package server\n+\n+import (\n+\t\"fmt\"\n+\t\"log\"\n+\t\"strconv\"\n+\n+\t\"github.com/apache/thrift/lib/go/thrift\"\n+\t\"github.com/luci/go-render/render\"\n+\t\"github.com/scootdev/scoot/workerapi/gen-go/worker\"\n+)\n+\n+func Serve(handler worker.Worker, addr string, transportFactory thrift.TTransportFactory, protocolFactory thrift.TProtocolFactory) error {\n+\ttransport, err := thrift.NewTServerSocket(addr)\n+\tif err != nil {\n+\t\treturn err\n+\t}\n+\tprocessor := worker.NewWorkerProcessor(handler)\n+\tserver := thrift.NewTSimpleServer4(processor, transport, transportFactory, protocolFactory)\n+\n+\tfmt.Println(\"About to serve\")\n+\n+\treturn server.Serve()\n+}\n+\n+type Handler struct {\n+\truns map[string]*worker.RunStatus\n+}\n+\n+func NewHandler() worker.Worker {\n+\treturn &Handler{make(map[string]*worker.RunStatus)}\n+}\n+\n+func (h *Handler) QueryWorker() (*worker.WorkerStatus, error) {\n+\twstatus := worker.NewWorkerStatus()\n+\twstatus.Running = []string{}\n+\tfor runId, status := range h.runs {\n+\t\tif status.Status == worker.Status_RUNNING {\n+\t\t\twstatus.Running = append(wstatus.Running, runId)\n+\t\t}\n+\t}\n+\treturn wstatus, nil\n+}\n+\n+func makeStatus(status worker.Status, exitCode int32, info string) *worker.RunStatus {\n+\trs := worker.NewRunStatus()\n+\trs.Status = status\n+\trs.Info = &info\n+\trs.ExitCode = &exitCode\n+\treturn rs\n+}\n+\n+//TODO: integrate runner lib and remove all this temp test code.","path":"workerapi/server/server.go","position":53,"original_position":53,"commit_id":"391bed1b9417751e8419274fbd053a3eed14f094","original_commit_id":"391bed1b9417751e8419274fbd053a3eed14f094","user":{"login":"dbentley","id":159980,"avatar_url":"https://avatars.githubusercontent.com/u/159980?v=3","gravatar_id":"","url":"https://api.github.com/users/dbentley","html_url":"https://github.com/dbentley","followers_url":"https://api.github.com/users/dbentley/followers","following_url":"https://api.github.com/users/dbentley/following{/other_user}","gists_url":"https://api.github.com/users/dbentley/gists{/gist_id}","starred_url":"https://api.github.com/users/dbentley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbentley/subscriptions","organizations_url":"https://api.github.com/users/dbentley/orgs","repos_url":"https://api.github.com/users/dbentley/repos","events_url":"https://api.github.com/users/dbentley/events{/privacy}","received_events_url":"https://api.github.com/users/dbentley/received_events","type":"User","site_admin":false},"body":"Oh, I see. Yeah, I'd think it might be easier to just integrate it now, but I don't want to block you.","created_at":"2016-07-05T16:35:36Z","updated_at":"2016-07-05T16:35:36Z","html_url":"https://github.com/scootdev/scoot/pull/46#discussion_r69595744","pull_request_url":"https://api.github.com/repos/scootdev/scoot/pulls/46","_links":{"self":{"href":"https://api.github.com/repos/scootdev/scoot/pulls/comments/69595744"},"html":{"href":"https://github.com/scootdev/scoot/pull/46#discussion_r69595744"},"pull_request":{"href":"https://api.github.com/repos/scootdev/scoot/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/scootdev/scoot/pulls/46","id":76223589,"html_url":"https://github.com/scootdev/scoot/pull/46","diff_url":"https://github.com/scootdev/scoot/pull/46.diff","patch_url":"https://github.com/scootdev/scoot/pull/46.patch","issue_url":"https://api.github.com/repos/scootdev/scoot/issues/46","number":46,"state":"open","locked":false,"title":"Added workerserver and workercl","user":{"login":"jasonbs10","id":1521929,"avatar_url":"https://avatars.githubusercontent.com/u/1521929?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonbs10","html_url":"https://github.com/jasonbs10","followers_url":"https://api.github.com/users/jasonbs10/followers","following_url":"https://api.github.com/users/jasonbs10/following{/other_user}","gists_url":"https://api.github.com/users/jasonbs10/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonbs10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonbs10/subscriptions","organizations_url":"https://api.github.com/users/jasonbs10/orgs","repos_url":"https://api.github.com/users/jasonbs10/repos","events_url":"https://api.github.com/users/jasonbs10/events{/privacy}","received_events_url":"https://api.github.com/users/jasonbs10/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-05T06:30:10Z","updated_at":"2016-07-05T16:35:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"98ba554dd9939a6ff26b25dab8b229568ba9ff91","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/scootdev/scoot/pulls/46/commits","review_comments_url":"https://api.github.com/repos/scootdev/scoot/pulls/46/comments","review_comment_url":"https://api.github.com/repos/scootdev/scoot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scootdev/scoot/issues/46/comments","statuses_url":"https://api.github.com/repos/scootdev/scoot/statuses/391bed1b9417751e8419274fbd053a3eed14f094","head":{"label":"scootdev:jschiller/worker","ref":"jschiller/worker","sha":"391bed1b9417751e8419274fbd053a3eed14f094","user":{"login":"scootdev","id":16392490,"avatar_url":"https://avatars.githubusercontent.com/u/16392490?v=3","gravatar_id":"","url":"https://api.github.com/users/scootdev","html_url":"https://github.com/scootdev","followers_url":"https://api.github.com/users/scootdev/followers","following_url":"https://api.github.com/users/scootdev/following{/other_user}","gists_url":"https://api.github.com/users/scootdev/gists{/gist_id}","starred_url":"https://api.github.com/users/scootdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scootdev/subscriptions","organizations_url":"https://api.github.com/users/scootdev/orgs","repos_url":"https://api.github.com/users/scootdev/repos","events_url":"https://api.github.com/users/scootdev/events{/privacy}","received_events_url":"https://api.github.com/users/scootdev/received_events","type":"Organization","site_admin":false},"repo":{"id":48396966,"name":"scoot","full_name":"scootdev/scoot","owner":{"login":"scootdev","id":16392490,"avatar_url":"https://avatars.githubusercontent.com/u/16392490?v=3","gravatar_id":"","url":"https://api.github.com/users/scootdev","html_url":"https://github.com/scootdev","followers_url":"https://api.github.com/users/scootdev/followers","following_url":"https://api.github.com/users/scootdev/following{/other_user}","gists_url":"https://api.github.com/users/scootdev/gists{/gist_id}","starred_url":"https://api.github.com/users/scootdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scootdev/subscriptions","organizations_url":"https://api.github.com/users/scootdev/orgs","repos_url":"https://api.github.com/users/scootdev/repos","events_url":"https://api.github.com/users/scootdev/events{/privacy}","received_events_url":"https://api.github.com/users/scootdev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scootdev/scoot","description":"","fork":false,"url":"https://api.github.com/repos/scootdev/scoot","forks_url":"https://api.github.com/repos/scootdev/scoot/forks","keys_url":"https://api.github.com/repos/scootdev/scoot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scootdev/scoot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scootdev/scoot/teams","hooks_url":"https://api.github.com/repos/scootdev/scoot/hooks","issue_events_url":"https://api.github.com/repos/scootdev/scoot/issues/events{/number}","events_url":"https://api.github.com/repos/scootdev/scoot/events","assignees_url":"https://api.github.com/repos/scootdev/scoot/assignees{/user}","branches_url":"https://api.github.com/repos/scootdev/scoot/branches{/branch}","tags_url":"https://api.github.com/repos/scootdev/scoot/tags","blobs_url":"https://api.github.com/repos/scootdev/scoot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scootdev/scoot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scootdev/scoot/git/refs{/sha}","trees_url":"https://api.github.com/repos/scootdev/scoot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scootdev/scoot/statuses/{sha}","languages_url":"https://api.github.com/repos/scootdev/scoot/languages","stargazers_url":"https://api.github.com/repos/scootdev/scoot/stargazers","contributors_url":"https://api.github.com/repos/scootdev/scoot/contributors","subscribers_url":"https://api.github.com/repos/scootdev/scoot/subscribers","subscription_url":"https://api.github.com/repos/scootdev/scoot/subscription","commits_url":"https://api.github.com/repos/scootdev/scoot/commits{/sha}","git_commits_url":"https://api.github.com/repos/scootdev/scoot/git/commits{/sha}","comments_url":"https://api.github.com/repos/scootdev/scoot/comments{/number}","issue_comment_url":"https://api.github.com/repos/scootdev/scoot/issues/comments{/number}","contents_url":"https://api.github.com/repos/scootdev/scoot/contents/{+path}","compare_url":"https://api.github.com/repos/scootdev/scoot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scootdev/scoot/merges","archive_url":"https://api.github.com/repos/scootdev/scoot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scootdev/scoot/downloads","issues_url":"https://api.github.com/repos/scootdev/scoot/issues{/number}","pulls_url":"https://api.github.com/repos/scootdev/scoot/pulls{/number}","milestones_url":"https://api.github.com/repos/scootdev/scoot/milestones{/number}","notifications_url":"https://api.github.com/repos/scootdev/scoot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scootdev/scoot/labels{/name}","releases_url":"https://api.github.com/repos/scootdev/scoot/releases{/id}","deployments_url":"https://api.github.com/repos/scootdev/scoot/deployments","created_at":"2015-12-21T22:14:54Z","updated_at":"2016-05-24T14:33:33Z","pushed_at":"2016-07-05T06:30:11Z","git_url":"git://github.com/scootdev/scoot.git","ssh_url":"git@github.com:scootdev/scoot.git","clone_url":"https://github.com/scootdev/scoot.git","svn_url":"https://github.com/scootdev/scoot","homepage":null,"size":6955,"stargazers_count":7,"watchers_count":7,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":7,"default_branch":"master"}},"base":{"label":"scootdev:master","ref":"master","sha":"b8c1dde1ab149db56e0f28359203dad1ff2ace5b","user":{"login":"scootdev","id":16392490,"avatar_url":"https://avatars.githubusercontent.com/u/16392490?v=3","gravatar_id":"","url":"https://api.github.com/users/scootdev","html_url":"https://github.com/scootdev","followers_url":"https://api.github.com/users/scootdev/followers","following_url":"https://api.github.com/users/scootdev/following{/other_user}","gists_url":"https://api.github.com/users/scootdev/gists{/gist_id}","starred_url":"https://api.github.com/users/scootdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scootdev/subscriptions","organizations_url":"https://api.github.com/users/scootdev/orgs","repos_url":"https://api.github.com/users/scootdev/repos","events_url":"https://api.github.com/users/scootdev/events{/privacy}","received_events_url":"https://api.github.com/users/scootdev/received_events","type":"Organization","site_admin":false},"repo":{"id":48396966,"name":"scoot","full_name":"scootdev/scoot","owner":{"login":"scootdev","id":16392490,"avatar_url":"https://avatars.githubusercontent.com/u/16392490?v=3","gravatar_id":"","url":"https://api.github.com/users/scootdev","html_url":"https://github.com/scootdev","followers_url":"https://api.github.com/users/scootdev/followers","following_url":"https://api.github.com/users/scootdev/following{/other_user}","gists_url":"https://api.github.com/users/scootdev/gists{/gist_id}","starred_url":"https://api.github.com/users/scootdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scootdev/subscriptions","organizations_url":"https://api.github.com/users/scootdev/orgs","repos_url":"https://api.github.com/users/scootdev/repos","events_url":"https://api.github.com/users/scootdev/events{/privacy}","received_events_url":"https://api.github.com/users/scootdev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scootdev/scoot","description":"","fork":false,"url":"https://api.github.com/repos/scootdev/scoot","forks_url":"https://api.github.com/repos/scootdev/scoot/forks","keys_url":"https://api.github.com/repos/scootdev/scoot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scootdev/scoot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scootdev/scoot/teams","hooks_url":"https://api.github.com/repos/scootdev/scoot/hooks","issue_events_url":"https://api.github.com/repos/scootdev/scoot/issues/events{/number}","events_url":"https://api.github.com/repos/scootdev/scoot/events","assignees_url":"https://api.github.com/repos/scootdev/scoot/assignees{/user}","branches_url":"https://api.github.com/repos/scootdev/scoot/branches{/branch}","tags_url":"https://api.github.com/repos/scootdev/scoot/tags","blobs_url":"https://api.github.com/repos/scootdev/scoot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scootdev/scoot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scootdev/scoot/git/refs{/sha}","trees_url":"https://api.github.com/repos/scootdev/scoot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scootdev/scoot/statuses/{sha}","languages_url":"https://api.github.com/repos/scootdev/scoot/languages","stargazers_url":"https://api.github.com/repos/scootdev/scoot/stargazers","contributors_url":"https://api.github.com/repos/scootdev/scoot/contributors","subscribers_url":"https://api.github.com/repos/scootdev/scoot/subscribers","subscription_url":"https://api.github.com/repos/scootdev/scoot/subscription","commits_url":"https://api.github.com/repos/scootdev/scoot/commits{/sha}","git_commits_url":"https://api.github.com/repos/scootdev/scoot/git/commits{/sha}","comments_url":"https://api.github.com/repos/scootdev/scoot/comments{/number}","issue_comment_url":"https://api.github.com/repos/scootdev/scoot/issues/comments{/number}","contents_url":"https://api.github.com/repos/scootdev/scoot/contents/{+path}","compare_url":"https://api.github.com/repos/scootdev/scoot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scootdev/scoot/merges","archive_url":"https://api.github.com/repos/scootdev/scoot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scootdev/scoot/downloads","issues_url":"https://api.github.com/repos/scootdev/scoot/issues{/number}","pulls_url":"https://api.github.com/repos/scootdev/scoot/pulls{/number}","milestones_url":"https://api.github.com/repos/scootdev/scoot/milestones{/number}","notifications_url":"https://api.github.com/repos/scootdev/scoot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scootdev/scoot/labels{/name}","releases_url":"https://api.github.com/repos/scootdev/scoot/releases{/id}","deployments_url":"https://api.github.com/repos/scootdev/scoot/deployments","created_at":"2015-12-21T22:14:54Z","updated_at":"2016-05-24T14:33:33Z","pushed_at":"2016-07-05T06:30:11Z","git_url":"git://github.com/scootdev/scoot.git","ssh_url":"git@github.com:scootdev/scoot.git","clone_url":"https://github.com/scootdev/scoot.git","svn_url":"https://github.com/scootdev/scoot","homepage":null,"size":6955,"stargazers_count":7,"watchers_count":7,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scootdev/scoot/pulls/46"},"html":{"href":"https://github.com/scootdev/scoot/pull/46"},"issue":{"href":"https://api.github.com/repos/scootdev/scoot/issues/46"},"comments":{"href":"https://api.github.com/repos/scootdev/scoot/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/scootdev/scoot/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/scootdev/scoot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scootdev/scoot/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/scootdev/scoot/statuses/391bed1b9417751e8419274fbd053a3eed14f094"}}}}
{"actor":{"display_login":"dbentley"}}