{"action":"created","comment":{"url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/comments/58221630","id":58221630,"diff_hunk":"@@ -0,0 +1,146 @@\n+package cromwell.backend\n+\n+import akka.actor.{Actor, ActorLogging}\n+import akka.event.LoggingReceive\n+import cromwell.backend.BackendActor._\n+import cromwell.backend.model.{JobDescriptor, WorkflowDescriptor}\n+\n+import scala.concurrent.Future\n+import scala.util.{Success, Failure}\n+\n+object BackendActor {\n+\n+  // Commands\n+  sealed trait BackendActorMessage\n+  case class Execute(jobDescriptor: JobDescriptor) extends BackendActorMessage\n+  case class Abort(jobDescriptor: JobDescriptor) extends BackendActorMessage\n+  case object AbortAll extends BackendActorMessage\n+  case class Recover(jobDescriptor: JobDescriptor) extends BackendActorMessage\n+\n+  // Events\n+  sealed trait BackendActorEvent\n+\n+  sealed trait ExecutionEvent extends BackendActorEvent\n+  case class ExecutionSucceeded(result: String) extends ExecutionEvent //Result TBD.\n+  case class ExecutionFailed(throwable: Throwable) extends ExecutionEvent\n+\n+  sealed trait AbortEvent extends BackendActorEvent\n+  case class AbortSucceeded(jobDescriptor: JobDescriptor) extends AbortEvent\n+  case class AbortFailed(throwable: Throwable) extends AbortEvent\n+\n+  sealed trait AbortAllEvent extends BackendActorEvent\n+  case class AbortAllSucceeded(jobDescriptor: List[JobDescriptor]) extends AbortAllEvent //Attributes TBD.\n+  case class AbortAllFailed(throwable: Throwable) extends AbortAllEvent\n+\n+  sealed trait RecoverEvent extends BackendActorEvent\n+  case class RecoverSucceeded(jobDescriptor: JobDescriptor) extends RecoverEvent //Same happens here.\n+  case class RecoverFailed(throwable: Throwable) extends RecoverEvent\n+\n+  sealed trait ValidationEvent extends BackendActorEvent\n+  case object ValidationSucceeded extends ValidationEvent\n+  case class ValidationFailed(throwable: Throwable) extends ValidationEvent\n+\n+  sealed trait BeforeAllEvent extends BackendActorEvent\n+  case object BeforeAllSucceeded extends BeforeAllEvent\n+  case class BeforeAllFailed(throwable: Throwable) extends BeforeAllEvent\n+\n+  sealed trait AfterAllEvent extends BackendActorEvent\n+  case object AfterAllSucceeded extends AfterAllEvent\n+  case class AfterAllFailed(throwable: Throwable) extends AfterAllEvent\n+\n+}\n+\n+/**\n+  * Defines basic structure and functionality to initialize and make use of a backend through an Akka actor system.\n+  * Backend functions should be implemented by each custom backend.\n+  */\n+trait BackendActor extends Actor with ActorLogging {\n+  import context.dispatcher\n+\n+  /**\n+    * Defines needed data to be able to execute a workflow.\n+    */\n+  val workflowDescriptor: WorkflowDescriptor\n+\n+  def receive: Receive = LoggingReceive {\n+    case Execute(jobDescriptor: JobDescriptor) =>\n+      val sndr = sender()\n+      execute(jobDescriptor) onComplete {","path":"backend/src/main/scala/cromwell/backend/BackendActor.scala","position":68,"original_position":68,"commit_id":"8ae48addb339e4fc87150c880d325aabb722aa7b","original_commit_id":"8ae48addb339e4fc87150c880d325aabb722aa7b","user":{"login":"geoffjentry","id":961771,"avatar_url":"https://avatars.githubusercontent.com/u/961771?v=3","gravatar_id":"","url":"https://api.github.com/users/geoffjentry","html_url":"https://github.com/geoffjentry","followers_url":"https://api.github.com/users/geoffjentry/followers","following_url":"https://api.github.com/users/geoffjentry/following{/other_user}","gists_url":"https://api.github.com/users/geoffjentry/gists{/gist_id}","starred_url":"https://api.github.com/users/geoffjentry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoffjentry/subscriptions","organizations_url":"https://api.github.com/users/geoffjentry/orgs","repos_url":"https://api.github.com/users/geoffjentry/repos","events_url":"https://api.github.com/users/geoffjentry/events{/privacy}","received_events_url":"https://api.github.com/users/geoffjentry/received_events","type":"User","site_admin":false},"body":"Could you use a pipeTo and pipe the execution event directly to the sender?","created_at":"2016-04-01T15:24:39Z","updated_at":"2016-04-01T15:24:39Z","html_url":"https://github.com/broadinstitute/cromwell/pull/604#discussion_r58221630","pull_request_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/604","_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/comments/58221630"},"html":{"href":"https://github.com/broadinstitute/cromwell/pull/604#discussion_r58221630"},"pull_request":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/604"}}},"pull_request":{"url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/604","id":63802158,"html_url":"https://github.com/broadinstitute/cromwell/pull/604","diff_url":"https://github.com/broadinstitute/cromwell/pull/604.diff","patch_url":"https://github.com/broadinstitute/cromwell/pull/604.patch","issue_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/604","number":604,"state":"open","locked":false,"title":"Initial commit to start discussing interfaces and implementation. Closes #550.","user":{"login":"francares","id":7405871,"avatar_url":"https://avatars.githubusercontent.com/u/7405871?v=3","gravatar_id":"","url":"https://api.github.com/users/francares","html_url":"https://github.com/francares","followers_url":"https://api.github.com/users/francares/followers","following_url":"https://api.github.com/users/francares/following{/other_user}","gists_url":"https://api.github.com/users/francares/gists{/gist_id}","starred_url":"https://api.github.com/users/francares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francares/subscriptions","organizations_url":"https://api.github.com/users/francares/orgs","repos_url":"https://api.github.com/users/francares/repos","events_url":"https://api.github.com/users/francares/events{/privacy}","received_events_url":"https://api.github.com/users/francares/received_events","type":"User","site_admin":false},"body":"This is the first iteration on the Cromwell-backend LCM design and implementation.\r\n\r\nThe idea is to start commenting on this in order to get a final initial version to start the implementation/refactoring of different backends.\r\n\r\nPlease, DO NOT MERGE.","created_at":"2016-03-22T22:15:46Z","updated_at":"2016-04-01T15:24:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5852657eb55c438d1505c53d1f1bc9a319e45d88","assignee":{"login":"geoffjentry","id":961771,"avatar_url":"https://avatars.githubusercontent.com/u/961771?v=3","gravatar_id":"","url":"https://api.github.com/users/geoffjentry","html_url":"https://github.com/geoffjentry","followers_url":"https://api.github.com/users/geoffjentry/followers","following_url":"https://api.github.com/users/geoffjentry/following{/other_user}","gists_url":"https://api.github.com/users/geoffjentry/gists{/gist_id}","starred_url":"https://api.github.com/users/geoffjentry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoffjentry/subscriptions","organizations_url":"https://api.github.com/users/geoffjentry/orgs","repos_url":"https://api.github.com/users/geoffjentry/repos","events_url":"https://api.github.com/users/geoffjentry/events{/privacy}","received_events_url":"https://api.github.com/users/geoffjentry/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/604/commits","review_comments_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/604/comments","review_comment_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/comments{/number}","comments_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/604/comments","statuses_url":"https://api.github.com/repos/broadinstitute/cromwell/statuses/8ae48addb339e4fc87150c880d325aabb722aa7b","head":{"label":"broadinstitute:fmc-PBE-Interfaces","ref":"fmc-PBE-Interfaces","sha":"8ae48addb339e4fc87150c880d325aabb722aa7b","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":34136406,"name":"cromwell","full_name":"broadinstitute/cromwell","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/cromwell","description":"Workflow Execution Engine using WDL","fork":false,"url":"https://api.github.com/repos/broadinstitute/cromwell","forks_url":"https://api.github.com/repos/broadinstitute/cromwell/forks","keys_url":"https://api.github.com/repos/broadinstitute/cromwell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/cromwell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/cromwell/teams","hooks_url":"https://api.github.com/repos/broadinstitute/cromwell/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/cromwell/events","assignees_url":"https://api.github.com/repos/broadinstitute/cromwell/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/cromwell/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/cromwell/tags","blobs_url":"https://api.github.com/repos/broadinstitute/cromwell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/cromwell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/cromwell/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/cromwell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/cromwell/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/cromwell/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/cromwell/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/cromwell/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/cromwell/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/cromwell/subscription","commits_url":"https://api.github.com/repos/broadinstitute/cromwell/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/cromwell/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/cromwell/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/cromwell/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/cromwell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/cromwell/merges","archive_url":"https://api.github.com/repos/broadinstitute/cromwell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/cromwell/downloads","issues_url":"https://api.github.com/repos/broadinstitute/cromwell/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/cromwell/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/cromwell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/cromwell/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/cromwell/releases{/id}","deployments_url":"https://api.github.com/repos/broadinstitute/cromwell/deployments","created_at":"2015-04-17T19:39:36Z","updated_at":"2016-04-01T13:27:38Z","pushed_at":"2016-04-01T15:18:06Z","git_url":"git://github.com/broadinstitute/cromwell.git","ssh_url":"git@github.com:broadinstitute/cromwell.git","clone_url":"https://github.com/broadinstitute/cromwell.git","svn_url":"https://github.com/broadinstitute/cromwell","homepage":"","size":6213,"stargazers_count":44,"watchers_count":44,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":12,"mirror_url":null,"open_issues_count":43,"forks":12,"open_issues":43,"watchers":44,"default_branch":"develop"}},"base":{"label":"broadinstitute:develop","ref":"develop","sha":"291a7daf548a9c1f3d945bf61ea74d8f6e25e19f","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":34136406,"name":"cromwell","full_name":"broadinstitute/cromwell","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/cromwell","description":"Workflow Execution Engine using WDL","fork":false,"url":"https://api.github.com/repos/broadinstitute/cromwell","forks_url":"https://api.github.com/repos/broadinstitute/cromwell/forks","keys_url":"https://api.github.com/repos/broadinstitute/cromwell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/cromwell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/cromwell/teams","hooks_url":"https://api.github.com/repos/broadinstitute/cromwell/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/cromwell/events","assignees_url":"https://api.github.com/repos/broadinstitute/cromwell/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/cromwell/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/cromwell/tags","blobs_url":"https://api.github.com/repos/broadinstitute/cromwell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/cromwell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/cromwell/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/cromwell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/cromwell/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/cromwell/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/cromwell/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/cromwell/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/cromwell/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/cromwell/subscription","commits_url":"https://api.github.com/repos/broadinstitute/cromwell/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/cromwell/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/cromwell/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/cromwell/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/cromwell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/cromwell/merges","archive_url":"https://api.github.com/repos/broadinstitute/cromwell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/cromwell/downloads","issues_url":"https://api.github.com/repos/broadinstitute/cromwell/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/cromwell/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/cromwell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/cromwell/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/cromwell/releases{/id}","deployments_url":"https://api.github.com/repos/broadinstitute/cromwell/deployments","created_at":"2015-04-17T19:39:36Z","updated_at":"2016-04-01T13:27:38Z","pushed_at":"2016-04-01T15:18:06Z","git_url":"git://github.com/broadinstitute/cromwell.git","ssh_url":"git@github.com:broadinstitute/cromwell.git","clone_url":"https://github.com/broadinstitute/cromwell.git","svn_url":"https://github.com/broadinstitute/cromwell","homepage":"","size":6213,"stargazers_count":44,"watchers_count":44,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":12,"mirror_url":null,"open_issues_count":43,"forks":12,"open_issues":43,"watchers":44,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/604"},"html":{"href":"https://github.com/broadinstitute/cromwell/pull/604"},"issue":{"href":"https://api.github.com/repos/broadinstitute/cromwell/issues/604"},"comments":{"href":"https://api.github.com/repos/broadinstitute/cromwell/issues/604/comments"},"review_comments":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/604/comments"},"review_comment":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/604/commits"},"statuses":{"href":"https://api.github.com/repos/broadinstitute/cromwell/statuses/8ae48addb339e4fc87150c880d325aabb722aa7b"}}}}