GitHub PullRequestReviewCommentEvent at 2014-12-22 16:26:37
Repository: akka
Actor: drewhk
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/akka/akka/pulls/comments/22175512","id":22175512,"diff_hunk":"@@ -0,0 +1,112 @@\n+/**\n+ * Copyright (C) 2014 Typesafe Inc. <http://www.typesafe.com>\n+ */\n+package docs.stream\n+\n+import java.net.InetSocketAddress\n+\n+import akka.actor.ActorSystem\n+import akka.stream.scaladsl.Concat\n+import akka.stream.scaladsl.Flow\n+import akka.stream.scaladsl.FlowGraphImplicits\n+import akka.stream.scaladsl.Source\n+import akka.stream.scaladsl.UndefinedSink\n+import akka.stream.scaladsl.UndefinedSource\n+import akka.stream.testkit.AkkaSpec\n+import akka.util.ByteString\n+\n+class StreamTcpDocSpec extends AkkaSpec {\n+\n+  implicit val ec = system.dispatcher\n+\n+  //#setup\n+  import akka.stream.FlowMaterializer\n+  import akka.stream.scaladsl.StreamTcp\n+  import akka.stream.scaladsl.StreamTcp._\n+\n+  implicit val sys = ActorSystem(\"stream-tcp-system\")\n+  implicit val mat = FlowMaterializer()\n+  //#setup\n+\n+  val localhost = new InetSocketAddress(\"127.0.0.1\", 8888)\n+\n+  \"simple client connection\" ignore {\n+    //#echo-server-simple-bind\n+    val localhost = new InetSocketAddress(\"127.0.0.1\", 8888)\n+    val binding = StreamTcp().bind(localhost)\n+    //#echo-server-simple-bind\n+\n+    //#echo-server-simple-handle\n+    val connections = binding.connections\n+\n+    connections foreach { connection =>\n+      println(s\"New connection from: ${connection.remoteAddress}\")\n+\n+      val echo = Flow[ByteString].map(_ ++ ByteString(\"!!!\\n\"))\n+      connection.handleWith(echo)\n+    }\n+    //#echo-server-simple-handle\n+\n+    /*\n+    //#echo-server-netcat\n+    $ echo -n \"Hello World\" | netcat 127.0.0.1 8888\n+    Hello World!!!\n+    //#echo-server-netcat\n+     */\n+  }\n+\n+  \"simple repl client\" ignore {\n+    val sys: ActorSystem = ???\n+\n+    //#repl-client\n+    val connection: OutgoingConnection = StreamTcp().outgoingConnection(localhost)\n+\n+    val repl = Flow[ByteString]\n+      .map(text => println(\"Server: \" + text.utf8String))\n+      .map(_ => readLine(\"> \"))\n+      .map {\n+        case \"q\"  =>\n+          sys.shutdown(); ByteString(\"BYE\")\n+        case text => ByteString(s\"$text\")\n+      }\n+\n+    connection.handleWith(repl)","path":"akka-docs-dev/rst/scala/code/docs/stream/StreamTcpDocSpec.scala","position":73,"original_position":73,"commit_id":"8c34a1e5e24340ec76239b00471518f7fd81088d","original_commit_id":"8c34a1e5e24340ec76239b00471518f7fd81088d","user":{"login":"drewhk","id":932285,"avatar_url":"https://avatars.githubusercontent.com/u/932285?v=3","gravatar_id":"","url":"https://api.github.com/users/drewhk","html_url":"https://github.com/drewhk","followers_url":"https://api.github.com/users/drewhk/followers","following_url":"https://api.github.com/users/drewhk/following{/other_user}","gists_url":"https://api.github.com/users/drewhk/gists{/gist_id}","starred_url":"https://api.github.com/users/drewhk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewhk/subscriptions","organizations_url":"https://api.github.com/users/drewhk/orgs","repos_url":"https://api.github.com/users/drewhk/repos","events_url":"https://api.github.com/users/drewhk/events{/privacy}","received_events_url":"https://api.github.com/users/drewhk/received_events","type":"User","site_admin":false},"body":"Explain the variant connection.flow.join(repl)","created_at":"2014-12-22T16:26:37Z","updated_at":"2014-12-22T16:26:37Z","html_url":"https://github.com/akka/akka/pull/16599#discussion_r22175512","pull_request_url":"https://api.github.com/repos/akka/akka/pulls/16599","_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/comments/22175512"},"html":{"href":"https://github.com/akka/akka/pull/16599#discussion_r22175512"},"pull_request":{"href":"https://api.github.com/repos/akka/akka/pulls/16599"}}},"pull_request":{"url":"https://api.github.com/repos/akka/akka/pulls/16599","id":26462060,"html_url":"https://github.com/akka/akka/pull/16599","diff_url":"https://github.com/akka/akka/pull/16599.diff","patch_url":"https://github.com/akka/akka/pull/16599.patch","issue_url":"https://api.github.com/repos/akka/akka/issues/16599","number":16599,"state":"open","locked":false,"title":"+doc StreamTCP docs","user":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?v=3","gravatar_id":"","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-12-22T15:23:16Z","updated_at":"2014-12-22T16:26:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d862beed4a7ded9138c1eb2b7b83c4949792bee8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/akka/akka/pulls/16599/commits","review_comments_url":"https://api.github.com/repos/akka/akka/pulls/16599/comments","review_comment_url":"https://api.github.com/repos/akka/akka/pulls/comments/{number}","comments_url":"https://api.github.com/repos/akka/akka/issues/16599/comments","statuses_url":"https://api.github.com/repos/akka/akka/statuses/8c34a1e5e24340ec76239b00471518f7fd81088d","head":{"label":"ktoso:docs-io-ktoso","ref":"docs-io-ktoso","sha":"8c34a1e5e24340ec76239b00471518f7fd81088d","user":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?v=3","gravatar_id":"","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"repo":{"id":4462204,"name":"akka","full_name":"ktoso/akka","owner":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?v=3","gravatar_id":"","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ktoso/akka","description":"Akka Project","fork":true,"url":"https://api.github.com/repos/ktoso/akka","forks_url":"https://api.github.com/repos/ktoso/akka/forks","keys_url":"https://api.github.com/repos/ktoso/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ktoso/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ktoso/akka/teams","hooks_url":"https://api.github.com/repos/ktoso/akka/hooks","issue_events_url":"https://api.github.com/repos/ktoso/akka/issues/events{/number}","events_url":"https://api.github.com/repos/ktoso/akka/events","assignees_url":"https://api.github.com/repos/ktoso/akka/assignees{/user}","branches_url":"https://api.github.com/repos/ktoso/akka/branches{/branch}","tags_url":"https://api.github.com/repos/ktoso/akka/tags","blobs_url":"https://api.github.com/repos/ktoso/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ktoso/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ktoso/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/ktoso/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ktoso/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/ktoso/akka/languages","stargazers_url":"https://api.github.com/repos/ktoso/akka/stargazers","contributors_url":"https://api.github.com/repos/ktoso/akka/contributors","subscribers_url":"https://api.github.com/repos/ktoso/akka/subscribers","subscription_url":"https://api.github.com/repos/ktoso/akka/subscription","commits_url":"https://api.github.com/repos/ktoso/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/ktoso/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/ktoso/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/ktoso/akka/issues/comments/{number}","contents_url":"https://api.github.com/repos/ktoso/akka/contents/{+path}","compare_url":"https://api.github.com/repos/ktoso/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ktoso/akka/merges","archive_url":"https://api.github.com/repos/ktoso/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ktoso/akka/downloads","issues_url":"https://api.github.com/repos/ktoso/akka/issues{/number}","pulls_url":"https://api.github.com/repos/ktoso/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/ktoso/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/ktoso/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ktoso/akka/labels{/name}","releases_url":"https://api.github.com/repos/ktoso/akka/releases{/id}","created_at":"2012-05-27T14:05:17Z","updated_at":"2014-12-03T15:22:34Z","pushed_at":"2014-12-22T15:25:56Z","git_url":"git://github.com/ktoso/akka.git","ssh_url":"git@github.com:ktoso/akka.git","clone_url":"https://github.com/ktoso/akka.git","svn_url":"https://github.com/ktoso/akka","homepage":"http://akka.io","size":156482,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"akka:release-2.3-dev","ref":"release-2.3-dev","sha":"bcc2c6044b43c7f9fc99eab8f39f34e0c28c7779","user":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"repo":{"id":130013,"name":"akka","full_name":"akka/akka","owner":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/akka/akka","description":"Akka Project","fork":false,"url":"https://api.github.com/repos/akka/akka","forks_url":"https://api.github.com/repos/akka/akka/forks","keys_url":"https://api.github.com/repos/akka/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akka/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akka/akka/teams","hooks_url":"https://api.github.com/repos/akka/akka/hooks","issue_events_url":"https://api.github.com/repos/akka/akka/issues/events{/number}","events_url":"https://api.github.com/repos/akka/akka/events","assignees_url":"https://api.github.com/repos/akka/akka/assignees{/user}","branches_url":"https://api.github.com/repos/akka/akka/branches{/branch}","tags_url":"https://api.github.com/repos/akka/akka/tags","blobs_url":"https://api.github.com/repos/akka/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akka/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akka/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/akka/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akka/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/akka/akka/languages","stargazers_url":"https://api.github.com/repos/akka/akka/stargazers","contributors_url":"https://api.github.com/repos/akka/akka/contributors","subscribers_url":"https://api.github.com/repos/akka/akka/subscribers","subscription_url":"https://api.github.com/repos/akka/akka/subscription","commits_url":"https://api.github.com/repos/akka/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/akka/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/akka/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/akka/akka/issues/comments/{number}","contents_url":"https://api.github.com/repos/akka/akka/contents/{+path}","compare_url":"https://api.github.com/repos/akka/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akka/akka/merges","archive_url":"https://api.github.com/repos/akka/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akka/akka/downloads","issues_url":"https://api.github.com/repos/akka/akka/issues{/number}","pulls_url":"https://api.github.com/repos/akka/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/akka/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/akka/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akka/akka/labels{/name}","releases_url":"https://api.github.com/repos/akka/akka/releases{/id}","created_at":"2009-02-16T12:51:54Z","updated_at":"2014-12-22T15:11:36Z","pushed_at":"2014-12-22T10:16:35Z","git_url":"git://github.com/akka/akka.git","ssh_url":"git@github.com:akka/akka.git","clone_url":"https://github.com/akka/akka.git","svn_url":"https://github.com/akka/akka","homepage":"http://akka.io","size":231587,"stargazers_count":3338,"watchers_count":3338,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":931,"mirror_url":null,"open_issues_count":541,"forks":931,"open_issues":541,"watchers":3338,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/16599"},"html":{"href":"https://github.com/akka/akka/pull/16599"},"issue":{"href":"https://api.github.com/repos/akka/akka/issues/16599"},"comments":{"href":"https://api.github.com/repos/akka/akka/issues/16599/comments"},"review_comments":{"href":"https://api.github.com/repos/akka/akka/pulls/16599/comments"},"review_comment":{"href":"https://api.github.com/repos/akka/akka/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/akka/akka/pulls/16599/commits"},"statuses":{"href":"https://api.github.com/repos/akka/akka/statuses/8c34a1e5e24340ec76239b00471518f7fd81088d"}}}}