{"action":"created","comment":{"url":"https://api.github.com/repos/spotify/flo/pulls/comments/188044888","pull_request_review_id":119941658,"id":188044888,"diff_hunk":"@@ -81,7 +86,26 @@ private static Config defaultConfig() {\n    * @return a {@link Result} with the value and throwable (if thrown)\n    */\n   public static <T> Result<T> runTask(Task<T> task, Config config) {\n-    return new Result<>(new FloRunner<T>(config).run(task));\n+    return new Result<>(new FloRunner<T>(config).run(task), loadTerminationHooks());\n+  }\n+\n+  private static Iterable<TerminationHook> loadTerminationHooks() {\n+    final ServiceLoader<TerminationHookFactory> factories =\n+        ServiceLoader.load(TerminationHookFactory.class);\n+\n+    return StreamSupport\n+        .stream(\n+            Spliterators.spliteratorUnknownSize(factories.iterator(), Spliterator.ORDERED), false)\n+        .filter(Objects::nonNull)\n+        .map(factory -> {\n+          try {\n+            return factory.create();","path":"flo-runner/src/main/java/com/spotify/flo/context/FloRunner.java","position":38,"original_position":38,"commit_id":"73f79b924888f3e1522ee34191f1d33022a8edb3","original_commit_id":"73f79b924888f3e1522ee34191f1d33022a8edb3","user":{"login":"honnix","id":158892,"avatar_url":"https://avatars0.githubusercontent.com/u/158892?v=4","gravatar_id":"","url":"https://api.github.com/users/honnix","html_url":"https://github.com/honnix","followers_url":"https://api.github.com/users/honnix/followers","following_url":"https://api.github.com/users/honnix/following{/other_user}","gists_url":"https://api.github.com/users/honnix/gists{/gist_id}","starred_url":"https://api.github.com/users/honnix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/honnix/subscriptions","organizations_url":"https://api.github.com/users/honnix/orgs","repos_url":"https://api.github.com/users/honnix/repos","events_url":"https://api.github.com/users/honnix/events{/privacy}","received_events_url":"https://api.github.com/users/honnix/received_events","type":"User","site_admin":false},"body":"Maybe `Objects.requireNonNull` to fail early.","created_at":"2018-05-14T18:02:09Z","updated_at":"2018-05-14T18:03:10Z","html_url":"https://github.com/spotify/flo/pull/69#discussion_r188044888","pull_request_url":"https://api.github.com/repos/spotify/flo/pulls/69","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/spotify/flo/pulls/comments/188044888"},"html":{"href":"https://github.com/spotify/flo/pull/69#discussion_r188044888"},"pull_request":{"href":"https://api.github.com/repos/spotify/flo/pulls/69"}}},"pull_request":{"url":"https://api.github.com/repos/spotify/flo/pulls/69","id":186667652,"html_url":"https://github.com/spotify/flo/pull/69","diff_url":"https://github.com/spotify/flo/pull/69.diff","patch_url":"https://github.com/spotify/flo/pull/69.patch","issue_url":"https://api.github.com/repos/spotify/flo/issues/69","number":69,"state":"open","locked":false,"title":"Add termination-hook capability","user":{"login":"NatashaL","id":4315174,"avatar_url":"https://avatars1.githubusercontent.com/u/4315174?v=4","gravatar_id":"","url":"https://api.github.com/users/NatashaL","html_url":"https://github.com/NatashaL","followers_url":"https://api.github.com/users/NatashaL/followers","following_url":"https://api.github.com/users/NatashaL/following{/other_user}","gists_url":"https://api.github.com/users/NatashaL/gists{/gist_id}","starred_url":"https://api.github.com/users/NatashaL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NatashaL/subscriptions","organizations_url":"https://api.github.com/users/NatashaL/orgs","repos_url":"https://api.github.com/users/NatashaL/repos","events_url":"https://api.github.com/users/NatashaL/events{/privacy}","received_events_url":"https://api.github.com/users/NatashaL/received_events","type":"User","site_admin":false},"body":"This alternative uses a service loader to load the injected dependencies.","created_at":"2018-05-08T15:14:30Z","updated_at":"2018-05-14T18:03:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ab4f917e796953099719abceb4bb8f7debd70604","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/spotify/flo/pulls/69/commits","review_comments_url":"https://api.github.com/repos/spotify/flo/pulls/69/comments","review_comment_url":"https://api.github.com/repos/spotify/flo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spotify/flo/issues/69/comments","statuses_url":"https://api.github.com/repos/spotify/flo/statuses/73f79b924888f3e1522ee34191f1d33022a8edb3","head":{"label":"spotify:termination-logging-hook","ref":"termination-logging-hook","sha":"73f79b924888f3e1522ee34191f1d33022a8edb3","user":{"login":"spotify","id":251374,"avatar_url":"https://avatars2.githubusercontent.com/u/251374?v=4","gravatar_id":"","url":"https://api.github.com/users/spotify","html_url":"https://github.com/spotify","followers_url":"https://api.github.com/users/spotify/followers","following_url":"https://api.github.com/users/spotify/following{/other_user}","gists_url":"https://api.github.com/users/spotify/gists{/gist_id}","starred_url":"https://api.github.com/users/spotify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spotify/subscriptions","organizations_url":"https://api.github.com/users/spotify/orgs","repos_url":"https://api.github.com/users/spotify/repos","events_url":"https://api.github.com/users/spotify/events{/privacy}","received_events_url":"https://api.github.com/users/spotify/received_events","type":"Organization","site_admin":false},"repo":{"id":46450575,"name":"flo","full_name":"spotify/flo","owner":{"login":"spotify","id":251374,"avatar_url":"https://avatars2.githubusercontent.com/u/251374?v=4","gravatar_id":"","url":"https://api.github.com/users/spotify","html_url":"https://github.com/spotify","followers_url":"https://api.github.com/users/spotify/followers","following_url":"https://api.github.com/users/spotify/following{/other_user}","gists_url":"https://api.github.com/users/spotify/gists{/gist_id}","starred_url":"https://api.github.com/users/spotify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spotify/subscriptions","organizations_url":"https://api.github.com/users/spotify/orgs","repos_url":"https://api.github.com/users/spotify/repos","events_url":"https://api.github.com/users/spotify/events{/privacy}","received_events_url":"https://api.github.com/users/spotify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spotify/flo","description":"A lightweight workflow definition library","fork":false,"url":"https://api.github.com/repos/spotify/flo","forks_url":"https://api.github.com/repos/spotify/flo/forks","keys_url":"https://api.github.com/repos/spotify/flo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spotify/flo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spotify/flo/teams","hooks_url":"https://api.github.com/repos/spotify/flo/hooks","issue_events_url":"https://api.github.com/repos/spotify/flo/issues/events{/number}","events_url":"https://api.github.com/repos/spotify/flo/events","assignees_url":"https://api.github.com/repos/spotify/flo/assignees{/user}","branches_url":"https://api.github.com/repos/spotify/flo/branches{/branch}","tags_url":"https://api.github.com/repos/spotify/flo/tags","blobs_url":"https://api.github.com/repos/spotify/flo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spotify/flo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spotify/flo/git/refs{/sha}","trees_url":"https://api.github.com/repos/spotify/flo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spotify/flo/statuses/{sha}","languages_url":"https://api.github.com/repos/spotify/flo/languages","stargazers_url":"https://api.github.com/repos/spotify/flo/stargazers","contributors_url":"https://api.github.com/repos/spotify/flo/contributors","subscribers_url":"https://api.github.com/repos/spotify/flo/subscribers","subscription_url":"https://api.github.com/repos/spotify/flo/subscription","commits_url":"https://api.github.com/repos/spotify/flo/commits{/sha}","git_commits_url":"https://api.github.com/repos/spotify/flo/git/commits{/sha}","comments_url":"https://api.github.com/repos/spotify/flo/comments{/number}","issue_comment_url":"https://api.github.com/repos/spotify/flo/issues/comments{/number}","contents_url":"https://api.github.com/repos/spotify/flo/contents/{+path}","compare_url":"https://api.github.com/repos/spotify/flo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spotify/flo/merges","archive_url":"https://api.github.com/repos/spotify/flo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spotify/flo/downloads","issues_url":"https://api.github.com/repos/spotify/flo/issues{/number}","pulls_url":"https://api.github.com/repos/spotify/flo/pulls{/number}","milestones_url":"https://api.github.com/repos/spotify/flo/milestones{/number}","notifications_url":"https://api.github.com/repos/spotify/flo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spotify/flo/labels{/name}","releases_url":"https://api.github.com/repos/spotify/flo/releases{/id}","deployments_url":"https://api.github.com/repos/spotify/flo/deployments","created_at":"2015-11-18T22:06:27Z","updated_at":"2018-05-09T18:29:40Z","pushed_at":"2018-05-14T17:08:06Z","git_url":"git://github.com/spotify/flo.git","ssh_url":"git@github.com:spotify/flo.git","clone_url":"https://github.com/spotify/flo.git","svn_url":"https://github.com/spotify/flo","homepage":"http://spotify.github.io/flo/maven/latest/","size":5339,"stargazers_count":33,"watchers_count":33,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":9,"open_issues":5,"watchers":33,"default_branch":"master"}},"base":{"label":"spotify:master","ref":"master","sha":"a1a8bbe3500d94faba18ae49152906082f13dd1d","user":{"login":"spotify","id":251374,"avatar_url":"https://avatars2.githubusercontent.com/u/251374?v=4","gravatar_id":"","url":"https://api.github.com/users/spotify","html_url":"https://github.com/spotify","followers_url":"https://api.github.com/users/spotify/followers","following_url":"https://api.github.com/users/spotify/following{/other_user}","gists_url":"https://api.github.com/users/spotify/gists{/gist_id}","starred_url":"https://api.github.com/users/spotify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spotify/subscriptions","organizations_url":"https://api.github.com/users/spotify/orgs","repos_url":"https://api.github.com/users/spotify/repos","events_url":"https://api.github.com/users/spotify/events{/privacy}","received_events_url":"https://api.github.com/users/spotify/received_events","type":"Organization","site_admin":false},"repo":{"id":46450575,"name":"flo","full_name":"spotify/flo","owner":{"login":"spotify","id":251374,"avatar_url":"https://avatars2.githubusercontent.com/u/251374?v=4","gravatar_id":"","url":"https://api.github.com/users/spotify","html_url":"https://github.com/spotify","followers_url":"https://api.github.com/users/spotify/followers","following_url":"https://api.github.com/users/spotify/following{/other_user}","gists_url":"https://api.github.com/users/spotify/gists{/gist_id}","starred_url":"https://api.github.com/users/spotify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spotify/subscriptions","organizations_url":"https://api.github.com/users/spotify/orgs","repos_url":"https://api.github.com/users/spotify/repos","events_url":"https://api.github.com/users/spotify/events{/privacy}","received_events_url":"https://api.github.com/users/spotify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spotify/flo","description":"A lightweight workflow definition library","fork":false,"url":"https://api.github.com/repos/spotify/flo","forks_url":"https://api.github.com/repos/spotify/flo/forks","keys_url":"https://api.github.com/repos/spotify/flo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spotify/flo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spotify/flo/teams","hooks_url":"https://api.github.com/repos/spotify/flo/hooks","issue_events_url":"https://api.github.com/repos/spotify/flo/issues/events{/number}","events_url":"https://api.github.com/repos/spotify/flo/events","assignees_url":"https://api.github.com/repos/spotify/flo/assignees{/user}","branches_url":"https://api.github.com/repos/spotify/flo/branches{/branch}","tags_url":"https://api.github.com/repos/spotify/flo/tags","blobs_url":"https://api.github.com/repos/spotify/flo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spotify/flo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spotify/flo/git/refs{/sha}","trees_url":"https://api.github.com/repos/spotify/flo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spotify/flo/statuses/{sha}","languages_url":"https://api.github.com/repos/spotify/flo/languages","stargazers_url":"https://api.github.com/repos/spotify/flo/stargazers","contributors_url":"https://api.github.com/repos/spotify/flo/contributors","subscribers_url":"https://api.github.com/repos/spotify/flo/subscribers","subscription_url":"https://api.github.com/repos/spotify/flo/subscription","commits_url":"https://api.github.com/repos/spotify/flo/commits{/sha}","git_commits_url":"https://api.github.com/repos/spotify/flo/git/commits{/sha}","comments_url":"https://api.github.com/repos/spotify/flo/comments{/number}","issue_comment_url":"https://api.github.com/repos/spotify/flo/issues/comments{/number}","contents_url":"https://api.github.com/repos/spotify/flo/contents/{+path}","compare_url":"https://api.github.com/repos/spotify/flo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spotify/flo/merges","archive_url":"https://api.github.com/repos/spotify/flo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spotify/flo/downloads","issues_url":"https://api.github.com/repos/spotify/flo/issues{/number}","pulls_url":"https://api.github.com/repos/spotify/flo/pulls{/number}","milestones_url":"https://api.github.com/repos/spotify/flo/milestones{/number}","notifications_url":"https://api.github.com/repos/spotify/flo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spotify/flo/labels{/name}","releases_url":"https://api.github.com/repos/spotify/flo/releases{/id}","deployments_url":"https://api.github.com/repos/spotify/flo/deployments","created_at":"2015-11-18T22:06:27Z","updated_at":"2018-05-09T18:29:40Z","pushed_at":"2018-05-14T17:08:06Z","git_url":"git://github.com/spotify/flo.git","ssh_url":"git@github.com:spotify/flo.git","clone_url":"https://github.com/spotify/flo.git","svn_url":"https://github.com/spotify/flo","homepage":"http://spotify.github.io/flo/maven/latest/","size":5339,"stargazers_count":33,"watchers_count":33,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":9,"open_issues":5,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spotify/flo/pulls/69"},"html":{"href":"https://github.com/spotify/flo/pull/69"},"issue":{"href":"https://api.github.com/repos/spotify/flo/issues/69"},"comments":{"href":"https://api.github.com/repos/spotify/flo/issues/69/comments"},"review_comments":{"href":"https://api.github.com/repos/spotify/flo/pulls/69/comments"},"review_comment":{"href":"https://api.github.com/repos/spotify/flo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spotify/flo/pulls/69/commits"},"statuses":{"href":"https://api.github.com/repos/spotify/flo/statuses/73f79b924888f3e1522ee34191f1d33022a8edb3"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"honnix"}}