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: streams/spec/src/main/asciidoc/architecture.asciidoc
+47-28Lines changed: 47 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -71,51 +71,70 @@ Methods that accept a `org.reactivestreams` interface do not need to be given th
71
71
== Design
72
72
73
73
The design of MicroProfile Reactive Streams is centered around **builders** for the various shapes of streams.
74
-
There are four different shapes of streams that can be built:
74
+
Each builder contains zero or more stages. There are three different shapes of stages:
75
75
76
-
* Processors. A processor has one inlet and one outlet, and is represented as a Reactive Streams `Processor` when built. This is called a `ProcessorBuilder`.
76
+
* Publisher. A publisher stage has an outlet, but no inlet.
77
77
78
-
* Publishers. A publisher has one outlet but no inlet, and is represented as a Reactive Streams `Publisher` when built. This is called a `PublisherBuilder`
* Subscribers. A subscriber has one inlet but no outlet, and it also has a result. It is represented as a product of a Reactive Streams `Subscriber` and a `CompletionStage` that is redeemed with the result, or error if the stream fails, when built. This is called a `SubscriberBuilder`.
80
+
* Processor. A processor stage has an inlet and an outlet.
* Subscribers. A subscriber has one inlet but no outlet, and it also has a result.
101
+
It is represented as a product of a Reactive Streams `Subscriber` and a `CompletionStage` that is redeemed with the result, or error if the stream fails, when built.
102
+
It contains zero or more processor stages, followed by a single subscriber stage. This is called a `SubscriberBuilder`.
<1> A processor that receives integers and emits them as strings.
118
-
<2> A subscriber that receives integers, and emits all the integers as Strings in a List when the stream completes.
133
+
<1> A publisher of integers 2 and 4.
134
+
<2> A subscriber that first doubles integers, then collects into a list.
135
+
<3> A closed graph that when run, will produce the result in a `CompletionStage`.
136
+
137
+
image::images/change-shape.svg[Combining two graphs,width=600,align="center"]
119
138
120
139
When MicroProfile specifications provide an API that uses Reactive Streams, it is intended that application developers can return and pass the builder interfaces directly to the MicroProfile APIs.
121
140
In many cases, application developers will not need to run the streams themselves.
0 commit comments