Skip to content

Commit

Permalink
Restructuration
Browse files Browse the repository at this point in the history
Signed-off-by: Clement Escoffier <clement.escoffier@gmail.com>
  • Loading branch information
cescoffier committed Jun 17, 2018
1 parent 86dc262 commit 6054777
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 20 deletions.
22 changes: 2 additions & 20 deletions streams/spec/src/main/asciidoc/architecture.asciidoc
Expand Up @@ -15,7 +15,7 @@
//

[[reactivestreamsarchitecture]]
== Architecture
== Introduction

This specification defines an API for manipulating Reactive Streams, providing operators such as `map`, `filter`, `flatMap`, in a similar fashion to the `java.util.streams` API introduced in Java 8.
It also provides an SPI for implementing and providing custom Reactive Streams engines, allowing application developers to use whichever engine they see fit.
Expand Down Expand Up @@ -68,9 +68,7 @@ For example, `getSubscriber` will be called `getRsSubscriber`.
This will allow new methods to be added in future that return `java.util.concurrent.Flow` interfaces, without the `Rs` in the name, allowing the existing `Rs` methods to be kept for a limited time for backwards compatibility.
Methods that accept a `org.reactivestreams` interface do not need to be given the same treatment, as support for the JDK9 interfaces can be added by overloading them, with backwards compatibility being maintained (see https://github.com/eclipse/microprofile-reactive/blob/master/approach.asciidoc[reactive approach for MicroProfile]).

=== Design

==== API
== Design

The design of MicroProfile Reactive Streams is centered around **builders** for the various shapes of streams.
There are four different shapes of streams that can be built:
Expand Down Expand Up @@ -125,19 +123,3 @@ The `CompletionSubscriber` class is so named because, where a `CompletionStage`

The `build` and `run` methods both provide a zero arg variant, which uses the default Reactive Streams engine provided by the platform, as well as a overload that takes a `ReactiveStreamsEngine`, allowing application developers to use a custom engine when they please.

==== SPI

The API is responsible for building graphs of stages based on the operators the user invoked.
The stages form an SPI for `ReactiveStreamsEngine` implementations to build into a running stream.
Examples of stages include:

* Map
* Filter
* Elements to publish
* Collect
* Instances of Reactive Streams `Publisher`, `Subscriber` and `Processor`

Each stage has either an inlet, an outlet, or both.
A graph is a sequence of stages, consecutive stages will have an outlet and and inlet so that they can join - a graph that has a stage with no outlet followed by a stage that has an inlet is impossible, for example.
Only the stages at the ends of the graph may have no inlet or outlet, whether these end stages have an inlet or outlet determines the shape of the overall graph.
The API is responsible for ensuring that as graphs are constructed, only graphs that are logically possible are passed to the `ReactiveStreamsEngine` to construct.
Expand Up @@ -37,3 +37,5 @@ include::license-alv2.asciidoc[]
include::architecture.asciidoc[]

include::examples.asciidoc[]

include::spi.asciidoc[]
33 changes: 33 additions & 0 deletions streams/spec/src/main/asciidoc/spi.asciidoc
@@ -0,0 +1,33 @@
//
// Copyright (c) 2018 Contributors to the Eclipse Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

== SPI

The API is responsible for building graphs of stages based on the operators the user invoked.
The stages form an SPI for `ReactiveStreamsEngine` implementations to build into a running stream.
Examples of stages include:

* Map
* Filter
* Elements to publish
* Collect
* Instances of Reactive Streams `Publisher`, `Subscriber` and `Processor`

Each stage has either an inlet, an outlet, or both.
A graph is a sequence of stages, consecutive stages will have an outlet and and inlet so that they can join - a graph that has a stage with no outlet followed by a stage that has an inlet is impossible, for example.
Only the stages at the ends of the graph may have no inlet or outlet, whether these end stages have an inlet or outlet determines the shape of the overall graph.
The API is responsible for ensuring that as graphs are constructed, only graphs that are logically possible are passed to the `ReactiveStreamsEngine` to construct.

0 comments on commit 6054777

Please sign in to comment.