{"action":"created","comment":{"url":"https://api.github.com/repos/scootdev/scoot/pulls/comments/65302605","id":65302605,"diff_hunk":"@@ -0,0 +1,72 @@\n+package saga\n+\n+import \"errors\"\n+import \"fmt\"\n+import \"sync\"\n+\n+/*\n+ * In Memory Implementation of a Saga Log, DOES NOT durably persist messages.\n+ * This is for local testing purposes.\n+ */\n+type inMemorySagaLog struct {\n+\tsagas map[string]*SagaState\n+\tmutex *sync.RWMutex","path":"saga/inMemorySagaLog.go","position":13,"original_position":13,"commit_id":"e95399a84566bbdfba0a4b3e7eeaf36a1ddca85e","original_commit_id":"e95399a84566bbdfba0a4b3e7eeaf36a1ddca85e","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":"I don't believe we want locking in this testing/example code. GetSagaState() gives the caller an unlocked pointer to state which LogMessage() can then alter concurrently. The code that operates on Saga structs should lock as necessary instead (assuming we continue to pass by pointer).","created_at":"2016-06-01T05:08:54Z","updated_at":"2016-06-01T05:08:54Z","html_url":"https://github.com/scootdev/scoot/pull/10#discussion_r65302605","pull_request_url":"https://api.github.com/repos/scootdev/scoot/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/scootdev/scoot/pulls/comments/65302605"},"html":{"href":"https://github.com/scootdev/scoot/pull/10#discussion_r65302605"},"pull_request":{"href":"https://api.github.com/repos/scootdev/scoot/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/scootdev/scoot/pulls/10","id":72104736,"html_url":"https://github.com/scootdev/scoot/pull/10","diff_url":"https://github.com/scootdev/scoot/pull/10.diff","patch_url":"https://github.com/scootdev/scoot/pull/10.patch","issue_url":"https://api.github.com/repos/scootdev/scoot/issues/10","number":10,"state":"open","locked":false,"title":"Sagas","user":{"login":"CaitieM20","id":3310141,"avatar_url":"https://avatars.githubusercontent.com/u/3310141?v=3","gravatar_id":"","url":"https://api.github.com/users/CaitieM20","html_url":"https://github.com/CaitieM20","followers_url":"https://api.github.com/users/CaitieM20/followers","following_url":"https://api.github.com/users/CaitieM20/following{/other_user}","gists_url":"https://api.github.com/users/CaitieM20/gists{/gist_id}","starred_url":"https://api.github.com/users/CaitieM20/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaitieM20/subscriptions","organizations_url":"https://api.github.com/users/CaitieM20/orgs","repos_url":"https://api.github.com/users/CaitieM20/repos","events_url":"https://api.github.com/users/CaitieM20/events{/privacy}","received_events_url":"https://api.github.com/users/CaitieM20/received_events","type":"User","site_admin":false},"body":"Implementing [Sagas](https://www.youtube.com/watch?v=xDuwrtwYHu8).  Sagas are how we are going to ensure all Tasks in a Job are completed.  \r\n\r\n### Code\r\n- Saga Struct & Methods give users an interface to program against, backed by a SagaLog\r\n- SagaLog Interface allows us to implement the durable backend.  \r\n- SagaState tracks SagaState.  Ensures messages added to a Saga are valid.  Currently not thread safe because there should be only One Go Routine updating an individual Saga at a time, this gives us thread safety and message ordering guarantees for free!\r\n-InMemorySagaLog, A non-durable Implementation of a SagaLog for demo & unit testing code.  \r\n\r\n### Tests\r\n- various test cases\r\n- introduced [gomocks](https://github.com/golang/mock) into the codebase for testing the Interface.  Checking in code generated code for now will add to build process in subsequent pull request\r\n\r\n### Demo\r\n- updated Demo code to use Sagas. \r\n- InMemory Saga prints received messages to the command line\r\n- run demo: go run sched/demo/main.go\r\n","created_at":"2016-06-01T00:02:40Z","updated_at":"2016-06-01T05:08:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"791d73407dd7d5f356f77183f1e05cd583065e8a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scootdev/scoot/pulls/10/commits","review_comments_url":"https://api.github.com/repos/scootdev/scoot/pulls/10/comments","review_comment_url":"https://api.github.com/repos/scootdev/scoot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scootdev/scoot/issues/10/comments","statuses_url":"https://api.github.com/repos/scootdev/scoot/statuses/e95399a84566bbdfba0a4b3e7eeaf36a1ddca85e","head":{"label":"scootdev:caitie/sagas","ref":"caitie/sagas","sha":"e95399a84566bbdfba0a4b3e7eeaf36a1ddca85e","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-06-01T00:12:20Z","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":52,"stargazers_count":7,"watchers_count":7,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":7,"default_branch":"master"}},"base":{"label":"scootdev:master","ref":"master","sha":"7667e7576be45e71dd939f4388436cf22eedb054","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-06-01T00:12:20Z","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":52,"stargazers_count":7,"watchers_count":7,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scootdev/scoot/pulls/10"},"html":{"href":"https://github.com/scootdev/scoot/pull/10"},"issue":{"href":"https://api.github.com/repos/scootdev/scoot/issues/10"},"comments":{"href":"https://api.github.com/repos/scootdev/scoot/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/scootdev/scoot/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/scootdev/scoot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scootdev/scoot/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/scootdev/scoot/statuses/e95399a84566bbdfba0a4b3e7eeaf36a1ddca85e"}}}}
{"actor":{"display_login":"jasonbs10"}}