Skip to content

Commit b3ed0ad

Browse files
committed
Docs: callback based -> callback-based
1 parent 3cc82f3 commit b3ed0ad

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

docs/reference/content/driver-async/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ title = "MongoDB Async Driver"
99

1010
## MongoDB Async Java Driver Documentation
1111

12-
The following guide provides information on using the callback based MongoDB Async Java Driver 3.4.
12+
The following guide provides information on using the callback-based MongoDB Async Java Driver 3.4.
1313

1414
{{% note %}}
1515
There are two higher level MongoDB Asynchronous Java Drivers available, that users may find easier to work with due to their friendlier APIs:

docs/reference/content/driver-async/reference/observables.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ title = "Observables"
1010

1111
## Observables
1212

13-
The MongoDB Async Driver is fully callback based and makes extensive use of [`SingleResultCallback<T>`]({{< apiref "com/mongodb/async/client/SingleResultCallback" >}}) to achieve this. The `SingleResultCallback<T>` interface requires the implementation of a single method `onResult(T result, Throwable t)` which is called once the operation has completed or errored. The `result` parameter contains the result of the operation if successful. If the operation failed for any reason then the `t` contains the `Throwable` reason for the failure. This pattern allows the users application logic to be deferred until the underlying network IO to MongoDB has been completed.
13+
The MongoDB Async Driver is fully callback-based and makes extensive use of [`SingleResultCallback<T>`]({{< apiref "com/mongodb/async/client/SingleResultCallback" >}}) to achieve this. The `SingleResultCallback<T>` interface requires the implementation of a single method `onResult(T result, Throwable t)` which is called once the operation has completed or errored. The `result` parameter contains the result of the operation if successful. If the operation failed for any reason then the `t` contains the `Throwable` reason for the failure. This pattern allows the users application logic to be deferred until the underlying network IO to MongoDB has been completed.
1414

1515
The callback pattern is extremely flexible but can quickly become unwieldy if the application logic requires a chain of operations. Nesting of callbacks can make code harder to read and give the appearance of making the codebase more complex that it actually is. To help with this we also have released two observable based asynchronous drivers:
1616

@@ -19,7 +19,7 @@ The callback pattern is extremely flexible but can quickly become unwieldy if th
1919

2020
These observable drivers follow similar patterns that split the logic into `onNext`, `onError` and `onComplete(d)` methods. These methods split out the logic used by `SingleResultCallback<T>.onResult(T result, Throwable t)` into individual components that can make the code easier to reason with.
2121

22-
The MongoDB Async Driver provides a factory and interfaces that do the heavy lifting of converting callback based operations into an observable operations. There are three interfaces [`Observable`]({{< apiref "com/mongodb/async/client/Observable" >}}), [`Subscription`]({{< apiref "com/mongodb/async/client/Subscription" >}}) and [`Observer`]({{< apiref "com/mongodb/async/client/Observer" >}}). The [`Observables`]({{< apiref "com/mongodb/async/client/Observables" >}}) helpers convert any callback based operations into observable operations.
22+
The MongoDB Async Driver provides a factory and interfaces that do the heavy lifting of converting callback-based operations into an observable operations. There are three interfaces [`Observable`]({{< apiref "com/mongodb/async/client/Observable" >}}), [`Subscription`]({{< apiref "com/mongodb/async/client/Subscription" >}}) and [`Observer`]({{< apiref "com/mongodb/async/client/Observer" >}}). The [`Observables`]({{< apiref "com/mongodb/async/client/Observables" >}}) helpers convert any callback-based operations into observable operations.
2323

2424
{{% note %}}
2525
The interfaces are similar to `Publisher`, `Subscription` and `Subscriber` interfaces from the [reactive streams](http://www.reactive-streams.org/) JVM implementation. However, we prefer the name `Observerable` to `Publisher` and `Observer` to `Subscriber` for readability purposes.
@@ -68,9 +68,9 @@ In the following example we iterate and print out all json forms of documents in
6868
});
6969
```
7070

71-
## Wrapping a callback based method
71+
## Wrapping a callback-based method
7272

73-
Creating an `Observable` from any callback based methods requires the wrapping of the method inside a [`Block`]({{< apiref "com/mongodb/Block" >}}). This allows the execution of the operation to be delayed, until demand is request by the `Subscription`. The method *must* use the supplied callback to convert the results into an `Observable`.
73+
Creating an `Observable` from any callback-based methods requires the wrapping of the method inside a [`Block`]({{< apiref "com/mongodb/Block" >}}). This allows the execution of the operation to be delayed, until demand is request by the `Subscription`. The method *must* use the supplied callback to convert the results into an `Observable`.
7474

7575
In the following example we print out the count of the number of documents in a collection:
7676

driver-async/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## The MongoDB Asynchronous Java Driver
22

3-
A callback based fully non-blocking and asynchronous I/O operations MongoDB Java driver.
3+
A callback-based fully non-blocking and asynchronous I/O operations MongoDB Java driver.
44

55
## Binaries
66

0 commit comments

Comments
 (0)