{"action":"created","comment":{"url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/pulls/comments/27659085","id":27659085,"diff_hunk":"@@ -0,0 +1,110 @@\n++++\n+date = \"2015-03-17T15:36:56Z\"\n+title = \"Quick Tour Primer\"\n+[menu.main]\n+  parent = \"Getting Started\"\n+  identifier = \"Primer\"\n+  weight = 20\n+  pre = \"<i class='fa'></i>\"\n++++\n+\n+# Quick Tour Primer\n+\n+The following code snippets come from the `SubscriberHelpers.java` example code\n+that can be found with the [examples source]({{< srcref \"tour/examples/tour/src/SubscriberHelpers.java\">}}).\n+\n+{{% note %}}\n+See the [installation guide]({{< relref \"getting-started/installation-guide.md\" >}})\n+for instructions on how to install the MongoDB Reactive Streams Java Driver.\n+{{% /note %}}\n+\n+## Reactive Streams\n+\n+This library is an implementation of the [reactive streams](http://www.reactive-streams.org) specification and the reactive stream API \n+consists of the following components:\n+\n+1. Publisher\n+2. Subscriber\n+3. Subscription\n+\n+A `Publisher` is a provider of a potentially unbounded number of sequenced elements, publishing them according to the demand received from its `Subscriber(s)`.\n+\n+In response to a call to `Publisher.subscribe(Subscriber)` the possible invocation sequences for methods on the `Subscriber` are given by the following protocol:\n+\n+```\n+onSubscribe onNext* (onError | onComplete)?\n+```\n+\n+This means that `onSubscribe` is always signalled, followed by a possibly unbounded number of `onNext` signals (as requested by `Subscriber`) \n+followed by an `onError` signal if there is a failure, or an `onComplete` signal when no more elements are available—all as long as \n+the `Subscription` is not cancelled.\n+\n+For more information about reactive streams go to: [http://www.reactive-streams.org](http://www.reactive-streams.org).\n+\n+\n+## From Async Callbacks to Subscribers\n+\n+The MongoDB Reactive Streams Java Driver is built upon the MongoDB Async driver which is callback driven.\n+The API mirrors the Async driver API and any methods that cause network IO return a `Publisher<T>`, \n+where `T` is the type of response for the document.  The exception to that rule is where the async driver can return a `null`\n+value in a callback, but in [reactive streams](http://www.reactive-streams.org) this is forbidden, so in these circumstances we\n+return a [`Success`]({{< apiref \"com/mongodb/reactivestreams/client/Success.html\">}}) on the operation.\n+\n+{{% note %}}\n+All [`Publishers`](http://www.reactive-streams.org/reactive-streams-1.0.0.RC4-javadoc/?org/reactivestreams/Publisher.html) returned \n+from the API are cold, meaning that nothing happens until they are subscribed to and the subscription makes a request. So just creating a \n+`Publisher` won't cause any network IO, its not util `Subscription.request()` is called that MongoDB is passed the operation.","path":"docs/reference/content/getting-started/quick-tour-primer.md","position":56,"original_position":56,"commit_id":"f22ad28d65fcca1594a7becdfaf8d1cd34672cac","original_commit_id":"f22ad28d65fcca1594a7becdfaf8d1cd34672cac","user":{"login":"jyemin","id":1111546,"avatar_url":"https://avatars.githubusercontent.com/u/1111546?v=3","gravatar_id":"","url":"https://api.github.com/users/jyemin","html_url":"https://github.com/jyemin","followers_url":"https://api.github.com/users/jyemin/followers","following_url":"https://api.github.com/users/jyemin/following{/other_user}","gists_url":"https://api.github.com/users/jyemin/gists{/gist_id}","starred_url":"https://api.github.com/users/jyemin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyemin/subscriptions","organizations_url":"https://api.github.com/users/jyemin/orgs","repos_url":"https://api.github.com/users/jyemin/repos","events_url":"https://api.github.com/users/jyemin/events{/privacy}","received_events_url":"https://api.github.com/users/jyemin/received_events","type":"User","site_admin":false},"body":"\"... is called that the driver executes the operation\"","created_at":"2015-04-02T14:02:04Z","updated_at":"2015-04-02T14:02:04Z","html_url":"https://github.com/rozza/mongo-java-driver-reactivestreams/pull/12#discussion_r27659085","pull_request_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/pulls/comments/27659085"},"html":{"href":"https://github.com/rozza/mongo-java-driver-reactivestreams/pull/12#discussion_r27659085"},"pull_request":{"href":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/pulls/12","id":32500792,"html_url":"https://github.com/rozza/mongo-java-driver-reactivestreams/pull/12","diff_url":"https://github.com/rozza/mongo-java-driver-reactivestreams/pull/12.diff","patch_url":"https://github.com/rozza/mongo-java-driver-reactivestreams/pull/12.patch","issue_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/issues/12","number":12,"state":"open","locked":false,"title":"Added docs site","user":{"login":"rozza","id":420,"avatar_url":"https://avatars.githubusercontent.com/u/420?v=3","gravatar_id":"","url":"https://api.github.com/users/rozza","html_url":"https://github.com/rozza","followers_url":"https://api.github.com/users/rozza/followers","following_url":"https://api.github.com/users/rozza/following{/other_user}","gists_url":"https://api.github.com/users/rozza/gists{/gist_id}","starred_url":"https://api.github.com/users/rozza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rozza/subscriptions","organizations_url":"https://api.github.com/users/rozza/orgs","repos_url":"https://api.github.com/users/rozza/repos","events_url":"https://api.github.com/users/rozza/events{/privacy}","received_events_url":"https://api.github.com/users/rozza/received_events","type":"User","site_admin":false},"body":"\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/rozza/mongo-java-driver-reactivestreams/12)\n<!-- Reviewable:end -->\n","created_at":"2015-04-02T10:46:31Z","updated_at":"2015-04-02T14:02:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9fb356d4ddae85bbe6fbbbf60949b320499dd89e","assignee":{"login":"jyemin","id":1111546,"avatar_url":"https://avatars.githubusercontent.com/u/1111546?v=3","gravatar_id":"","url":"https://api.github.com/users/jyemin","html_url":"https://github.com/jyemin","followers_url":"https://api.github.com/users/jyemin/followers","following_url":"https://api.github.com/users/jyemin/following{/other_user}","gists_url":"https://api.github.com/users/jyemin/gists{/gist_id}","starred_url":"https://api.github.com/users/jyemin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyemin/subscriptions","organizations_url":"https://api.github.com/users/jyemin/orgs","repos_url":"https://api.github.com/users/jyemin/repos","events_url":"https://api.github.com/users/jyemin/events{/privacy}","received_events_url":"https://api.github.com/users/jyemin/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/pulls/12/commits","review_comments_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/pulls/12/comments","review_comment_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/issues/12/comments","statuses_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/statuses/f22ad28d65fcca1594a7becdfaf8d1cd34672cac","head":{"label":"rozza:docs","ref":"docs","sha":"f22ad28d65fcca1594a7becdfaf8d1cd34672cac","user":{"login":"rozza","id":420,"avatar_url":"https://avatars.githubusercontent.com/u/420?v=3","gravatar_id":"","url":"https://api.github.com/users/rozza","html_url":"https://github.com/rozza","followers_url":"https://api.github.com/users/rozza/followers","following_url":"https://api.github.com/users/rozza/following{/other_user}","gists_url":"https://api.github.com/users/rozza/gists{/gist_id}","starred_url":"https://api.github.com/users/rozza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rozza/subscriptions","organizations_url":"https://api.github.com/users/rozza/orgs","repos_url":"https://api.github.com/users/rozza/repos","events_url":"https://api.github.com/users/rozza/events{/privacy}","received_events_url":"https://api.github.com/users/rozza/received_events","type":"User","site_admin":false},"repo":{"id":28095123,"name":"mongo-java-driver-reactivestreams","full_name":"rozza/mongo-java-driver-reactivestreams","owner":{"login":"rozza","id":420,"avatar_url":"https://avatars.githubusercontent.com/u/420?v=3","gravatar_id":"","url":"https://api.github.com/users/rozza","html_url":"https://github.com/rozza","followers_url":"https://api.github.com/users/rozza/followers","following_url":"https://api.github.com/users/rozza/following{/other_user}","gists_url":"https://api.github.com/users/rozza/gists{/gist_id}","starred_url":"https://api.github.com/users/rozza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rozza/subscriptions","organizations_url":"https://api.github.com/users/rozza/orgs","repos_url":"https://api.github.com/users/rozza/repos","events_url":"https://api.github.com/users/rozza/events{/privacy}","received_events_url":"https://api.github.com/users/rozza/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rozza/mongo-java-driver-reactivestreams","description":"Reactive streams implementation of the Mongo Java Driver","fork":false,"url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams","forks_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/forks","keys_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/teams","hooks_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/hooks","issue_events_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/issues/events{/number}","events_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/events","assignees_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/assignees{/user}","branches_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/branches{/branch}","tags_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/tags","blobs_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/git/refs{/sha}","trees_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/statuses/{sha}","languages_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/languages","stargazers_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/stargazers","contributors_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/contributors","subscribers_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/subscribers","subscription_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/subscription","commits_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/commits{/sha}","git_commits_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/git/commits{/sha}","comments_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/comments{/number}","issue_comment_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/issues/comments{/number}","contents_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/contents/{+path}","compare_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/merges","archive_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/downloads","issues_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/issues{/number}","pulls_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/pulls{/number}","milestones_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/milestones{/number}","notifications_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/labels{/name}","releases_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/releases{/id}","created_at":"2014-12-16T16:16:46Z","updated_at":"2015-04-02T10:28:48Z","pushed_at":"2015-04-02T10:47:28Z","git_url":"git://github.com/rozza/mongo-java-driver-reactivestreams.git","ssh_url":"git@github.com:rozza/mongo-java-driver-reactivestreams.git","clone_url":"https://github.com/rozza/mongo-java-driver-reactivestreams.git","svn_url":"https://github.com/rozza/mongo-java-driver-reactivestreams","homepage":null,"size":838,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"rozza:master","ref":"master","sha":"908606746444f8e3d29757cbb429c6e1b710014d","user":{"login":"rozza","id":420,"avatar_url":"https://avatars.githubusercontent.com/u/420?v=3","gravatar_id":"","url":"https://api.github.com/users/rozza","html_url":"https://github.com/rozza","followers_url":"https://api.github.com/users/rozza/followers","following_url":"https://api.github.com/users/rozza/following{/other_user}","gists_url":"https://api.github.com/users/rozza/gists{/gist_id}","starred_url":"https://api.github.com/users/rozza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rozza/subscriptions","organizations_url":"https://api.github.com/users/rozza/orgs","repos_url":"https://api.github.com/users/rozza/repos","events_url":"https://api.github.com/users/rozza/events{/privacy}","received_events_url":"https://api.github.com/users/rozza/received_events","type":"User","site_admin":false},"repo":{"id":28095123,"name":"mongo-java-driver-reactivestreams","full_name":"rozza/mongo-java-driver-reactivestreams","owner":{"login":"rozza","id":420,"avatar_url":"https://avatars.githubusercontent.com/u/420?v=3","gravatar_id":"","url":"https://api.github.com/users/rozza","html_url":"https://github.com/rozza","followers_url":"https://api.github.com/users/rozza/followers","following_url":"https://api.github.com/users/rozza/following{/other_user}","gists_url":"https://api.github.com/users/rozza/gists{/gist_id}","starred_url":"https://api.github.com/users/rozza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rozza/subscriptions","organizations_url":"https://api.github.com/users/rozza/orgs","repos_url":"https://api.github.com/users/rozza/repos","events_url":"https://api.github.com/users/rozza/events{/privacy}","received_events_url":"https://api.github.com/users/rozza/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rozza/mongo-java-driver-reactivestreams","description":"Reactive streams implementation of the Mongo Java Driver","fork":false,"url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams","forks_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/forks","keys_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/teams","hooks_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/hooks","issue_events_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/issues/events{/number}","events_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/events","assignees_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/assignees{/user}","branches_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/branches{/branch}","tags_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/tags","blobs_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/git/refs{/sha}","trees_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/statuses/{sha}","languages_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/languages","stargazers_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/stargazers","contributors_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/contributors","subscribers_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/subscribers","subscription_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/subscription","commits_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/commits{/sha}","git_commits_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/git/commits{/sha}","comments_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/comments{/number}","issue_comment_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/issues/comments{/number}","contents_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/contents/{+path}","compare_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/merges","archive_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/downloads","issues_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/issues{/number}","pulls_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/pulls{/number}","milestones_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/milestones{/number}","notifications_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/labels{/name}","releases_url":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/releases{/id}","created_at":"2014-12-16T16:16:46Z","updated_at":"2015-04-02T10:28:48Z","pushed_at":"2015-04-02T10:47:28Z","git_url":"git://github.com/rozza/mongo-java-driver-reactivestreams.git","ssh_url":"git@github.com:rozza/mongo-java-driver-reactivestreams.git","clone_url":"https://github.com/rozza/mongo-java-driver-reactivestreams.git","svn_url":"https://github.com/rozza/mongo-java-driver-reactivestreams","homepage":null,"size":838,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/pulls/12"},"html":{"href":"https://github.com/rozza/mongo-java-driver-reactivestreams/pull/12"},"issue":{"href":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/issues/12"},"comments":{"href":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/rozza/mongo-java-driver-reactivestreams/statuses/f22ad28d65fcca1594a7becdfaf8d1cd34672cac"}}}}