You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/indexes.txt
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,32 @@ To use an example from this page, copy the code example into the
35
35
Be sure to replace all placeholders in the code examples, such as ``<connection string URI>``, with
36
36
the relevant values for your MongoDB deployment.
37
37
38
+
Project Reactor Implementation
39
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40
+
41
+
This guide uses the {+pr+} library to consume ``Publisher`` instances returned
42
+
by the {+driver-short+} methods. To learn more about the {+pr+} library
43
+
and how to use it, see `Getting Started <https://projectreactor.io/docs/core/release/reference/#getting-started>`__
44
+
in the Reactor documentation.
45
+
46
+
There are also other ways to consume ``Publisher`` instances. You can use one of many alternative libraries such as
47
+
`RxJava <https://github.com/ReactiveX/RxJava>`__ or call ``Publisher.subscribe()`` directly and pass your own
48
+
implementation of a ``Subscriber``.
49
+
50
+
This guide uses the ``Mono.block()`` method from Reactor to subscribe to a ``Publisher`` and block the current
51
+
thread until the ``Publisher`` reaches its terminal state. To learn more about the Reactive Streams initiative, see `Reactive Streams <https://www.reactive-streams.org/>`__.
52
+
53
+
.. important:: Publishers Returned are Cold
54
+
55
+
All ``Publisher`` instances returned by the {+driver-short+} methods are cold,
56
+
which means that the corresponding operation does not happen unless you
57
+
subscribe to the returned ``Publisher``. We recommend only subscribing to
58
+
the returned ``Publisher`` once, because subscribing more than once can lead
0 commit comments