{"action":"created","comment":{"url":"https://api.github.com/repos/k3po/k3po/pulls/comments/43536127","id":43536127,"diff_hunk":"@@ -218,32 +200,41 @@ public String getObservedScript() {\n         return (progress != null) ? progress.getObservedScript() : null;\n     }\n \n-    public boolean isDestroyed() {\n-        return destroyed;\n-    }\n+    public ChannelFuture dispose() {\n+        if (preparedFuture == null) {\n+            // no need to clean up if never started\n+            disposedFuture.setSuccess();\n+        } else if (!disposedFuture.isDone()) {\n+            ChannelFuture future = abort();\n+            future.addListener(new ChannelFutureListener() {\n \n-    public boolean destroy() {\n-\n-        if (destroyed) {\n-            return true;\n-        }\n-\n-        abort();\n+                @Override\n+                public void operationComplete(ChannelFuture future) throws Exception {\n+                    // close server and client channels\n+                    // final ChannelGroupFuture closeFuture =\n+                    serverChannels.close().addListener(new ChannelGroupFutureListener() {\n+\n+                        @Override\n+                        public void operationComplete(ChannelGroupFuture future) throws Exception {\n+                            clientChannels.close();\n+                            try {\n+                                bootstrapFactory.shutdown();\n+                                bootstrapFactory.releaseExternalResources();\n+                            } catch (Exception e) {\n+                                if (LOGGER.isDebugEnabled()) {\n+                                    LOGGER.error(\"Caught exception releasing resources\", e);\n+                                }","path":"driver/src/main/java/org/kaazing/k3po/driver/internal/Robot.java","position":103,"original_position":103,"commit_id":"f54336847d0ba80550133d5a8b52c9e9d76cba1a","original_commit_id":"f54336847d0ba80550133d5a8b52c9e9d76cba1a","user":{"login":"jfallows","id":2099911,"avatar_url":"https://avatars.githubusercontent.com/u/2099911?v=3","gravatar_id":"","url":"https://api.github.com/users/jfallows","html_url":"https://github.com/jfallows","followers_url":"https://api.github.com/users/jfallows/followers","following_url":"https://api.github.com/users/jfallows/following{/other_user}","gists_url":"https://api.github.com/users/jfallows/gists{/gist_id}","starred_url":"https://api.github.com/users/jfallows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfallows/subscriptions","organizations_url":"https://api.github.com/users/jfallows/orgs","repos_url":"https://api.github.com/users/jfallows/repos","events_url":"https://api.github.com/users/jfallows/events{/privacy}","received_events_url":"https://api.github.com/users/jfallows/received_events","type":"User","site_admin":false},"body":"Do you think the `disposedFuture` should fail here? What would that imply for the caller?","created_at":"2015-10-30T18:25:07Z","updated_at":"2015-10-30T18:25:07Z","html_url":"https://github.com/k3po/k3po/pull/241#discussion_r43536127","pull_request_url":"https://api.github.com/repos/k3po/k3po/pulls/241","_links":{"self":{"href":"https://api.github.com/repos/k3po/k3po/pulls/comments/43536127"},"html":{"href":"https://github.com/k3po/k3po/pull/241#discussion_r43536127"},"pull_request":{"href":"https://api.github.com/repos/k3po/k3po/pulls/241"}}},"pull_request":{"url":"https://api.github.com/repos/k3po/k3po/pulls/241","id":48637517,"html_url":"https://github.com/k3po/k3po/pull/241","diff_url":"https://github.com/k3po/k3po/pull/241.diff","patch_url":"https://github.com/k3po/k3po/pull/241.patch","issue_url":"https://api.github.com/repos/k3po/k3po/issues/241","number":241,"state":"open","locked":false,"title":"Added Dispose/Disposed to command and event protocol to clean up k3po driver","user":{"login":"dpwspoon","id":2014623,"avatar_url":"https://avatars.githubusercontent.com/u/2014623?v=3","gravatar_id":"","url":"https://api.github.com/users/dpwspoon","html_url":"https://github.com/dpwspoon","followers_url":"https://api.github.com/users/dpwspoon/followers","following_url":"https://api.github.com/users/dpwspoon/following{/other_user}","gists_url":"https://api.github.com/users/dpwspoon/gists{/gist_id}","starred_url":"https://api.github.com/users/dpwspoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpwspoon/subscriptions","organizations_url":"https://api.github.com/users/dpwspoon/orgs","repos_url":"https://api.github.com/users/dpwspoon/repos","events_url":"https://api.github.com/users/dpwspoon/events{/privacy}","received_events_url":"https://api.github.com/users/dpwspoon/received_events","type":"User","site_admin":false},"body":"Resolves https://github.com/k3po/k3po/issues/239","created_at":"2015-10-23T22:32:43Z","updated_at":"2015-10-30T18:25:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"968673649b173696be166c7ff865e860045d6539","assignee":{"login":"jfallows","id":2099911,"avatar_url":"https://avatars.githubusercontent.com/u/2099911?v=3","gravatar_id":"","url":"https://api.github.com/users/jfallows","html_url":"https://github.com/jfallows","followers_url":"https://api.github.com/users/jfallows/followers","following_url":"https://api.github.com/users/jfallows/following{/other_user}","gists_url":"https://api.github.com/users/jfallows/gists{/gist_id}","starred_url":"https://api.github.com/users/jfallows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfallows/subscriptions","organizations_url":"https://api.github.com/users/jfallows/orgs","repos_url":"https://api.github.com/users/jfallows/repos","events_url":"https://api.github.com/users/jfallows/events{/privacy}","received_events_url":"https://api.github.com/users/jfallows/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/k3po/k3po/pulls/241/commits","review_comments_url":"https://api.github.com/repos/k3po/k3po/pulls/241/comments","review_comment_url":"https://api.github.com/repos/k3po/k3po/pulls/comments{/number}","comments_url":"https://api.github.com/repos/k3po/k3po/issues/241/comments","statuses_url":"https://api.github.com/repos/k3po/k3po/statuses/f54336847d0ba80550133d5a8b52c9e9d76cba1a","head":{"label":"dpwspoon:dispose_cmd","ref":"dispose_cmd","sha":"f54336847d0ba80550133d5a8b52c9e9d76cba1a","user":{"login":"dpwspoon","id":2014623,"avatar_url":"https://avatars.githubusercontent.com/u/2014623?v=3","gravatar_id":"","url":"https://api.github.com/users/dpwspoon","html_url":"https://github.com/dpwspoon","followers_url":"https://api.github.com/users/dpwspoon/followers","following_url":"https://api.github.com/users/dpwspoon/following{/other_user}","gists_url":"https://api.github.com/users/dpwspoon/gists{/gist_id}","starred_url":"https://api.github.com/users/dpwspoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpwspoon/subscriptions","organizations_url":"https://api.github.com/users/dpwspoon/orgs","repos_url":"https://api.github.com/users/dpwspoon/repos","events_url":"https://api.github.com/users/dpwspoon/events{/privacy}","received_events_url":"https://api.github.com/users/dpwspoon/received_events","type":"User","site_admin":false},"repo":{"id":32608918,"name":"k3po","full_name":"dpwspoon/k3po","owner":{"login":"dpwspoon","id":2014623,"avatar_url":"https://avatars.githubusercontent.com/u/2014623?v=3","gravatar_id":"","url":"https://api.github.com/users/dpwspoon","html_url":"https://github.com/dpwspoon","followers_url":"https://api.github.com/users/dpwspoon/followers","following_url":"https://api.github.com/users/dpwspoon/following{/other_user}","gists_url":"https://api.github.com/users/dpwspoon/gists{/gist_id}","starred_url":"https://api.github.com/users/dpwspoon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpwspoon/subscriptions","organizations_url":"https://api.github.com/users/dpwspoon/orgs","repos_url":"https://api.github.com/users/dpwspoon/repos","events_url":"https://api.github.com/users/dpwspoon/events{/privacy}","received_events_url":"https://api.github.com/users/dpwspoon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dpwspoon/k3po","description":"K3PO Protocol Droid. Testing the \"I\" in IoT.","fork":true,"url":"https://api.github.com/repos/dpwspoon/k3po","forks_url":"https://api.github.com/repos/dpwspoon/k3po/forks","keys_url":"https://api.github.com/repos/dpwspoon/k3po/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dpwspoon/k3po/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dpwspoon/k3po/teams","hooks_url":"https://api.github.com/repos/dpwspoon/k3po/hooks","issue_events_url":"https://api.github.com/repos/dpwspoon/k3po/issues/events{/number}","events_url":"https://api.github.com/repos/dpwspoon/k3po/events","assignees_url":"https://api.github.com/repos/dpwspoon/k3po/assignees{/user}","branches_url":"https://api.github.com/repos/dpwspoon/k3po/branches{/branch}","tags_url":"https://api.github.com/repos/dpwspoon/k3po/tags","blobs_url":"https://api.github.com/repos/dpwspoon/k3po/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dpwspoon/k3po/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dpwspoon/k3po/git/refs{/sha}","trees_url":"https://api.github.com/repos/dpwspoon/k3po/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dpwspoon/k3po/statuses/{sha}","languages_url":"https://api.github.com/repos/dpwspoon/k3po/languages","stargazers_url":"https://api.github.com/repos/dpwspoon/k3po/stargazers","contributors_url":"https://api.github.com/repos/dpwspoon/k3po/contributors","subscribers_url":"https://api.github.com/repos/dpwspoon/k3po/subscribers","subscription_url":"https://api.github.com/repos/dpwspoon/k3po/subscription","commits_url":"https://api.github.com/repos/dpwspoon/k3po/commits{/sha}","git_commits_url":"https://api.github.com/repos/dpwspoon/k3po/git/commits{/sha}","comments_url":"https://api.github.com/repos/dpwspoon/k3po/comments{/number}","issue_comment_url":"https://api.github.com/repos/dpwspoon/k3po/issues/comments{/number}","contents_url":"https://api.github.com/repos/dpwspoon/k3po/contents/{+path}","compare_url":"https://api.github.com/repos/dpwspoon/k3po/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dpwspoon/k3po/merges","archive_url":"https://api.github.com/repos/dpwspoon/k3po/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dpwspoon/k3po/downloads","issues_url":"https://api.github.com/repos/dpwspoon/k3po/issues{/number}","pulls_url":"https://api.github.com/repos/dpwspoon/k3po/pulls{/number}","milestones_url":"https://api.github.com/repos/dpwspoon/k3po/milestones{/number}","notifications_url":"https://api.github.com/repos/dpwspoon/k3po/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dpwspoon/k3po/labels{/name}","releases_url":"https://api.github.com/repos/dpwspoon/k3po/releases{/id}","created_at":"2015-03-20T21:51:37Z","updated_at":"2015-04-23T17:24:11Z","pushed_at":"2015-10-26T21:58:19Z","git_url":"git://github.com/dpwspoon/k3po.git","ssh_url":"git@github.com:dpwspoon/k3po.git","clone_url":"https://github.com/dpwspoon/k3po.git","svn_url":"https://github.com/dpwspoon/k3po","homepage":"","size":5966,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"develop"}},"base":{"label":"k3po:develop","ref":"develop","sha":"11a052a5e31b346b1df4e74b320424888d2a97a2","user":{"login":"k3po","id":10240063,"avatar_url":"https://avatars.githubusercontent.com/u/10240063?v=3","gravatar_id":"","url":"https://api.github.com/users/k3po","html_url":"https://github.com/k3po","followers_url":"https://api.github.com/users/k3po/followers","following_url":"https://api.github.com/users/k3po/following{/other_user}","gists_url":"https://api.github.com/users/k3po/gists{/gist_id}","starred_url":"https://api.github.com/users/k3po/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k3po/subscriptions","organizations_url":"https://api.github.com/users/k3po/orgs","repos_url":"https://api.github.com/users/k3po/repos","events_url":"https://api.github.com/users/k3po/events{/privacy}","received_events_url":"https://api.github.com/users/k3po/received_events","type":"Organization","site_admin":false},"repo":{"id":18419894,"name":"k3po","full_name":"k3po/k3po","owner":{"login":"k3po","id":10240063,"avatar_url":"https://avatars.githubusercontent.com/u/10240063?v=3","gravatar_id":"","url":"https://api.github.com/users/k3po","html_url":"https://github.com/k3po","followers_url":"https://api.github.com/users/k3po/followers","following_url":"https://api.github.com/users/k3po/following{/other_user}","gists_url":"https://api.github.com/users/k3po/gists{/gist_id}","starred_url":"https://api.github.com/users/k3po/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k3po/subscriptions","organizations_url":"https://api.github.com/users/k3po/orgs","repos_url":"https://api.github.com/users/k3po/repos","events_url":"https://api.github.com/users/k3po/events{/privacy}","received_events_url":"https://api.github.com/users/k3po/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/k3po/k3po","description":"K3PO Protocol Droid. Testing the \"I\" in IoT.","fork":false,"url":"https://api.github.com/repos/k3po/k3po","forks_url":"https://api.github.com/repos/k3po/k3po/forks","keys_url":"https://api.github.com/repos/k3po/k3po/keys{/key_id}","collaborators_url":"https://api.github.com/repos/k3po/k3po/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/k3po/k3po/teams","hooks_url":"https://api.github.com/repos/k3po/k3po/hooks","issue_events_url":"https://api.github.com/repos/k3po/k3po/issues/events{/number}","events_url":"https://api.github.com/repos/k3po/k3po/events","assignees_url":"https://api.github.com/repos/k3po/k3po/assignees{/user}","branches_url":"https://api.github.com/repos/k3po/k3po/branches{/branch}","tags_url":"https://api.github.com/repos/k3po/k3po/tags","blobs_url":"https://api.github.com/repos/k3po/k3po/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/k3po/k3po/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/k3po/k3po/git/refs{/sha}","trees_url":"https://api.github.com/repos/k3po/k3po/git/trees{/sha}","statuses_url":"https://api.github.com/repos/k3po/k3po/statuses/{sha}","languages_url":"https://api.github.com/repos/k3po/k3po/languages","stargazers_url":"https://api.github.com/repos/k3po/k3po/stargazers","contributors_url":"https://api.github.com/repos/k3po/k3po/contributors","subscribers_url":"https://api.github.com/repos/k3po/k3po/subscribers","subscription_url":"https://api.github.com/repos/k3po/k3po/subscription","commits_url":"https://api.github.com/repos/k3po/k3po/commits{/sha}","git_commits_url":"https://api.github.com/repos/k3po/k3po/git/commits{/sha}","comments_url":"https://api.github.com/repos/k3po/k3po/comments{/number}","issue_comment_url":"https://api.github.com/repos/k3po/k3po/issues/comments{/number}","contents_url":"https://api.github.com/repos/k3po/k3po/contents/{+path}","compare_url":"https://api.github.com/repos/k3po/k3po/compare/{base}...{head}","merges_url":"https://api.github.com/repos/k3po/k3po/merges","archive_url":"https://api.github.com/repos/k3po/k3po/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/k3po/k3po/downloads","issues_url":"https://api.github.com/repos/k3po/k3po/issues{/number}","pulls_url":"https://api.github.com/repos/k3po/k3po/pulls{/number}","milestones_url":"https://api.github.com/repos/k3po/k3po/milestones{/number}","notifications_url":"https://api.github.com/repos/k3po/k3po/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/k3po/k3po/labels{/name}","releases_url":"https://api.github.com/repos/k3po/k3po/releases{/id}","created_at":"2014-04-03T22:14:18Z","updated_at":"2015-09-20T14:27:19Z","pushed_at":"2015-10-30T17:31:48Z","git_url":"git://github.com/k3po/k3po.git","ssh_url":"git@github.com:k3po/k3po.git","clone_url":"https://github.com/k3po/k3po.git","svn_url":"https://github.com/k3po/k3po","homepage":"","size":9516,"stargazers_count":18,"watchers_count":18,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":71,"forks":21,"open_issues":71,"watchers":18,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/k3po/k3po/pulls/241"},"html":{"href":"https://github.com/k3po/k3po/pull/241"},"issue":{"href":"https://api.github.com/repos/k3po/k3po/issues/241"},"comments":{"href":"https://api.github.com/repos/k3po/k3po/issues/241/comments"},"review_comments":{"href":"https://api.github.com/repos/k3po/k3po/pulls/241/comments"},"review_comment":{"href":"https://api.github.com/repos/k3po/k3po/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/k3po/k3po/pulls/241/commits"},"statuses":{"href":"https://api.github.com/repos/k3po/k3po/statuses/f54336847d0ba80550133d5a8b52c9e9d76cba1a"}}}}