{"action":"created","comment":{"url":"https://api.github.com/repos/abrandoned/protobuf-nats/pulls/comments/149509575","pull_request_review_id":74914943,"id":149509575,"diff_hunk":"@@ -68,9 +71,14 @@ def connect(options = {})\n         @connection\n       end\n \n-      # Do not depend on #close for a greaceful disconnect.\n+      def connection\n+        return @connection unless @connection.nil?\n+        connect(options || {})","path":"lib/protobuf/nats/jnats.rb","position":31,"original_position":31,"commit_id":"d3b63c295d27feac5b627ca210da8743d911a040","original_commit_id":"d3b63c295d27feac5b627ca210da8743d911a040","user":{"login":"abrandoned","id":329800,"avatar_url":"https://avatars2.githubusercontent.com/u/329800?v=4","gravatar_id":"","url":"https://api.github.com/users/abrandoned","html_url":"https://github.com/abrandoned","followers_url":"https://api.github.com/users/abrandoned/followers","following_url":"https://api.github.com/users/abrandoned/following{/other_user}","gists_url":"https://api.github.com/users/abrandoned/gists{/gist_id}","starred_url":"https://api.github.com/users/abrandoned/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abrandoned/subscriptions","organizations_url":"https://api.github.com/users/abrandoned/orgs","repos_url":"https://api.github.com/users/abrandoned/repos","events_url":"https://api.github.com/users/abrandoned/events{/privacy}","received_events_url":"https://api.github.com/users/abrandoned/received_events","type":"User","site_admin":false},"body":"should this path call `close`?  (or at the top of `connect`?)","created_at":"2017-11-07T21:31:12Z","updated_at":"2017-11-07T21:31:12Z","html_url":"https://github.com/abrandoned/protobuf-nats/pull/35#discussion_r149509575","pull_request_url":"https://api.github.com/repos/abrandoned/protobuf-nats/pulls/35","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/abrandoned/protobuf-nats/pulls/comments/149509575"},"html":{"href":"https://github.com/abrandoned/protobuf-nats/pull/35#discussion_r149509575"},"pull_request":{"href":"https://api.github.com/repos/abrandoned/protobuf-nats/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/abrandoned/protobuf-nats/pulls/35","id":151226334,"html_url":"https://github.com/abrandoned/protobuf-nats/pull/35","diff_url":"https://github.com/abrandoned/protobuf-nats/pull/35.diff","patch_url":"https://github.com/abrandoned/protobuf-nats/pull/35.patch","issue_url":"https://api.github.com/repos/abrandoned/protobuf-nats/issues/35","number":35,"state":"open","locked":false,"title":"Dealing with createMsgChannel errors","user":{"login":"film42","id":1043908,"avatar_url":"https://avatars2.githubusercontent.com/u/1043908?v=4","gravatar_id":"","url":"https://api.github.com/users/film42","html_url":"https://github.com/film42","followers_url":"https://api.github.com/users/film42/followers","following_url":"https://api.github.com/users/film42/following{/other_user}","gists_url":"https://api.github.com/users/film42/gists{/gist_id}","starred_url":"https://api.github.com/users/film42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/film42/subscriptions","organizations_url":"https://api.github.com/users/film42/orgs","repos_url":"https://api.github.com/users/film42/repos","events_url":"https://api.github.com/users/film42/events{/privacy}","received_events_url":"https://api.github.com/users/film42/received_events","type":"User","site_admin":false},"body":"I'm taking a stab at https://github.com/abrandoned/protobuf-nats/issues/32 but can't be sure if this fixes it just yet.\r\n\r\nHere's what I'm trying:\r\n1. Make the `start_client_nats_connection` avoid setting the memo until the client connection has completed.\r\n2. Check `@start_client_nats_connection && @client_nats_connection` when memo-ing the client nats connection setup. I'm not sure this is actually addressing anything because in the examples we were clearly inside an instance of `JNats` but only the inner `@connection` was `nil`.\r\n3. Retry connecting with the same options provided to `#connect` should we ever find the `@connection` `nil`. I'm not sure this is the best idea, but if we get \"no servers found\" errors we'll know there's a race condition in the setup code. I added a test here but I'm not sure we'll want to keep this behavior forever.\r\n\r\nNOTE: This is pointed at @abrandoned 's pre-released branch right now.\r\n\r\ncc @abrandoned @quixoten \r\n","created_at":"2017-11-07T21:02:19Z","updated_at":"2017-11-07T21:31:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bac952de24e7b60b6526ad2e6a1101c7b92a9344","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/abrandoned/protobuf-nats/pulls/35/commits","review_comments_url":"https://api.github.com/repos/abrandoned/protobuf-nats/pulls/35/comments","review_comment_url":"https://api.github.com/repos/abrandoned/protobuf-nats/pulls/comments{/number}","comments_url":"https://api.github.com/repos/abrandoned/protobuf-nats/issues/35/comments","statuses_url":"https://api.github.com/repos/abrandoned/protobuf-nats/statuses/d3b63c295d27feac5b627ca210da8743d911a040","head":{"label":"abrandoned:gt/whats_up_with_chans","ref":"gt/whats_up_with_chans","sha":"d3b63c295d27feac5b627ca210da8743d911a040","user":{"login":"abrandoned","id":329800,"avatar_url":"https://avatars2.githubusercontent.com/u/329800?v=4","gravatar_id":"","url":"https://api.github.com/users/abrandoned","html_url":"https://github.com/abrandoned","followers_url":"https://api.github.com/users/abrandoned/followers","following_url":"https://api.github.com/users/abrandoned/following{/other_user}","gists_url":"https://api.github.com/users/abrandoned/gists{/gist_id}","starred_url":"https://api.github.com/users/abrandoned/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abrandoned/subscriptions","organizations_url":"https://api.github.com/users/abrandoned/orgs","repos_url":"https://api.github.com/users/abrandoned/repos","events_url":"https://api.github.com/users/abrandoned/events{/privacy}","received_events_url":"https://api.github.com/users/abrandoned/received_events","type":"User","site_admin":false},"repo":{"id":85212517,"name":"protobuf-nats","full_name":"abrandoned/protobuf-nats","owner":{"login":"abrandoned","id":329800,"avatar_url":"https://avatars2.githubusercontent.com/u/329800?v=4","gravatar_id":"","url":"https://api.github.com/users/abrandoned","html_url":"https://github.com/abrandoned","followers_url":"https://api.github.com/users/abrandoned/followers","following_url":"https://api.github.com/users/abrandoned/following{/other_user}","gists_url":"https://api.github.com/users/abrandoned/gists{/gist_id}","starred_url":"https://api.github.com/users/abrandoned/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abrandoned/subscriptions","organizations_url":"https://api.github.com/users/abrandoned/orgs","repos_url":"https://api.github.com/users/abrandoned/repos","events_url":"https://api.github.com/users/abrandoned/events{/privacy}","received_events_url":"https://api.github.com/users/abrandoned/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abrandoned/protobuf-nats","description":null,"fork":false,"url":"https://api.github.com/repos/abrandoned/protobuf-nats","forks_url":"https://api.github.com/repos/abrandoned/protobuf-nats/forks","keys_url":"https://api.github.com/repos/abrandoned/protobuf-nats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abrandoned/protobuf-nats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abrandoned/protobuf-nats/teams","hooks_url":"https://api.github.com/repos/abrandoned/protobuf-nats/hooks","issue_events_url":"https://api.github.com/repos/abrandoned/protobuf-nats/issues/events{/number}","events_url":"https://api.github.com/repos/abrandoned/protobuf-nats/events","assignees_url":"https://api.github.com/repos/abrandoned/protobuf-nats/assignees{/user}","branches_url":"https://api.github.com/repos/abrandoned/protobuf-nats/branches{/branch}","tags_url":"https://api.github.com/repos/abrandoned/protobuf-nats/tags","blobs_url":"https://api.github.com/repos/abrandoned/protobuf-nats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abrandoned/protobuf-nats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abrandoned/protobuf-nats/git/refs{/sha}","trees_url":"https://api.github.com/repos/abrandoned/protobuf-nats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abrandoned/protobuf-nats/statuses/{sha}","languages_url":"https://api.github.com/repos/abrandoned/protobuf-nats/languages","stargazers_url":"https://api.github.com/repos/abrandoned/protobuf-nats/stargazers","contributors_url":"https://api.github.com/repos/abrandoned/protobuf-nats/contributors","subscribers_url":"https://api.github.com/repos/abrandoned/protobuf-nats/subscribers","subscription_url":"https://api.github.com/repos/abrandoned/protobuf-nats/subscription","commits_url":"https://api.github.com/repos/abrandoned/protobuf-nats/commits{/sha}","git_commits_url":"https://api.github.com/repos/abrandoned/protobuf-nats/git/commits{/sha}","comments_url":"https://api.github.com/repos/abrandoned/protobuf-nats/comments{/number}","issue_comment_url":"https://api.github.com/repos/abrandoned/protobuf-nats/issues/comments{/number}","contents_url":"https://api.github.com/repos/abrandoned/protobuf-nats/contents/{+path}","compare_url":"https://api.github.com/repos/abrandoned/protobuf-nats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abrandoned/protobuf-nats/merges","archive_url":"https://api.github.com/repos/abrandoned/protobuf-nats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abrandoned/protobuf-nats/downloads","issues_url":"https://api.github.com/repos/abrandoned/protobuf-nats/issues{/number}","pulls_url":"https://api.github.com/repos/abrandoned/protobuf-nats/pulls{/number}","milestones_url":"https://api.github.com/repos/abrandoned/protobuf-nats/milestones{/number}","notifications_url":"https://api.github.com/repos/abrandoned/protobuf-nats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abrandoned/protobuf-nats/labels{/name}","releases_url":"https://api.github.com/repos/abrandoned/protobuf-nats/releases{/id}","deployments_url":"https://api.github.com/repos/abrandoned/protobuf-nats/deployments","created_at":"2017-03-16T15:37:15Z","updated_at":"2017-11-07T15:52:48Z","pushed_at":"2017-11-07T21:05:34Z","git_url":"git://github.com/abrandoned/protobuf-nats.git","ssh_url":"git@github.com:abrandoned/protobuf-nats.git","clone_url":"https://github.com/abrandoned/protobuf-nats.git","svn_url":"https://github.com/abrandoned/protobuf-nats","homepage":null,"size":572,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":1,"default_branch":"master"}},"base":{"label":"abrandoned:abrandoned/nats_subscription_pooling","ref":"abrandoned/nats_subscription_pooling","sha":"d9fa54e5fe17f5df30bd62fa558370f9d1c497df","user":{"login":"abrandoned","id":329800,"avatar_url":"https://avatars2.githubusercontent.com/u/329800?v=4","gravatar_id":"","url":"https://api.github.com/users/abrandoned","html_url":"https://github.com/abrandoned","followers_url":"https://api.github.com/users/abrandoned/followers","following_url":"https://api.github.com/users/abrandoned/following{/other_user}","gists_url":"https://api.github.com/users/abrandoned/gists{/gist_id}","starred_url":"https://api.github.com/users/abrandoned/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abrandoned/subscriptions","organizations_url":"https://api.github.com/users/abrandoned/orgs","repos_url":"https://api.github.com/users/abrandoned/repos","events_url":"https://api.github.com/users/abrandoned/events{/privacy}","received_events_url":"https://api.github.com/users/abrandoned/received_events","type":"User","site_admin":false},"repo":{"id":85212517,"name":"protobuf-nats","full_name":"abrandoned/protobuf-nats","owner":{"login":"abrandoned","id":329800,"avatar_url":"https://avatars2.githubusercontent.com/u/329800?v=4","gravatar_id":"","url":"https://api.github.com/users/abrandoned","html_url":"https://github.com/abrandoned","followers_url":"https://api.github.com/users/abrandoned/followers","following_url":"https://api.github.com/users/abrandoned/following{/other_user}","gists_url":"https://api.github.com/users/abrandoned/gists{/gist_id}","starred_url":"https://api.github.com/users/abrandoned/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abrandoned/subscriptions","organizations_url":"https://api.github.com/users/abrandoned/orgs","repos_url":"https://api.github.com/users/abrandoned/repos","events_url":"https://api.github.com/users/abrandoned/events{/privacy}","received_events_url":"https://api.github.com/users/abrandoned/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abrandoned/protobuf-nats","description":null,"fork":false,"url":"https://api.github.com/repos/abrandoned/protobuf-nats","forks_url":"https://api.github.com/repos/abrandoned/protobuf-nats/forks","keys_url":"https://api.github.com/repos/abrandoned/protobuf-nats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abrandoned/protobuf-nats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abrandoned/protobuf-nats/teams","hooks_url":"https://api.github.com/repos/abrandoned/protobuf-nats/hooks","issue_events_url":"https://api.github.com/repos/abrandoned/protobuf-nats/issues/events{/number}","events_url":"https://api.github.com/repos/abrandoned/protobuf-nats/events","assignees_url":"https://api.github.com/repos/abrandoned/protobuf-nats/assignees{/user}","branches_url":"https://api.github.com/repos/abrandoned/protobuf-nats/branches{/branch}","tags_url":"https://api.github.com/repos/abrandoned/protobuf-nats/tags","blobs_url":"https://api.github.com/repos/abrandoned/protobuf-nats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abrandoned/protobuf-nats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abrandoned/protobuf-nats/git/refs{/sha}","trees_url":"https://api.github.com/repos/abrandoned/protobuf-nats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abrandoned/protobuf-nats/statuses/{sha}","languages_url":"https://api.github.com/repos/abrandoned/protobuf-nats/languages","stargazers_url":"https://api.github.com/repos/abrandoned/protobuf-nats/stargazers","contributors_url":"https://api.github.com/repos/abrandoned/protobuf-nats/contributors","subscribers_url":"https://api.github.com/repos/abrandoned/protobuf-nats/subscribers","subscription_url":"https://api.github.com/repos/abrandoned/protobuf-nats/subscription","commits_url":"https://api.github.com/repos/abrandoned/protobuf-nats/commits{/sha}","git_commits_url":"https://api.github.com/repos/abrandoned/protobuf-nats/git/commits{/sha}","comments_url":"https://api.github.com/repos/abrandoned/protobuf-nats/comments{/number}","issue_comment_url":"https://api.github.com/repos/abrandoned/protobuf-nats/issues/comments{/number}","contents_url":"https://api.github.com/repos/abrandoned/protobuf-nats/contents/{+path}","compare_url":"https://api.github.com/repos/abrandoned/protobuf-nats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abrandoned/protobuf-nats/merges","archive_url":"https://api.github.com/repos/abrandoned/protobuf-nats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abrandoned/protobuf-nats/downloads","issues_url":"https://api.github.com/repos/abrandoned/protobuf-nats/issues{/number}","pulls_url":"https://api.github.com/repos/abrandoned/protobuf-nats/pulls{/number}","milestones_url":"https://api.github.com/repos/abrandoned/protobuf-nats/milestones{/number}","notifications_url":"https://api.github.com/repos/abrandoned/protobuf-nats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abrandoned/protobuf-nats/labels{/name}","releases_url":"https://api.github.com/repos/abrandoned/protobuf-nats/releases{/id}","deployments_url":"https://api.github.com/repos/abrandoned/protobuf-nats/deployments","created_at":"2017-03-16T15:37:15Z","updated_at":"2017-11-07T15:52:48Z","pushed_at":"2017-11-07T21:05:34Z","git_url":"git://github.com/abrandoned/protobuf-nats.git","ssh_url":"git@github.com:abrandoned/protobuf-nats.git","clone_url":"https://github.com/abrandoned/protobuf-nats.git","svn_url":"https://github.com/abrandoned/protobuf-nats","homepage":null,"size":572,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/abrandoned/protobuf-nats/pulls/35"},"html":{"href":"https://github.com/abrandoned/protobuf-nats/pull/35"},"issue":{"href":"https://api.github.com/repos/abrandoned/protobuf-nats/issues/35"},"comments":{"href":"https://api.github.com/repos/abrandoned/protobuf-nats/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/abrandoned/protobuf-nats/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/abrandoned/protobuf-nats/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/abrandoned/protobuf-nats/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/abrandoned/protobuf-nats/statuses/d3b63c295d27feac5b627ca210da8743d911a040"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"abrandoned"}}