From 88e013b99b5f5d3df5ca816e7e313c0a79fa05d1 Mon Sep 17 00:00:00 2001 From: Konrad Malawski Date: Wed, 15 Apr 2015 17:47:09 +0200 Subject: [PATCH] =str #16608 adds section in readme explaining null is illegal --- akka-docs-dev/rst/java/stream-flows-and-basics.rst | 5 +++++ akka-docs-dev/rst/scala/stream-flows-and-basics.rst | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/akka-docs-dev/rst/java/stream-flows-and-basics.rst b/akka-docs-dev/rst/java/stream-flows-and-basics.rst index 2e8f4db9e2..b76b6a0351 100644 --- a/akka-docs-dev/rst/java/stream-flows-and-basics.rst +++ b/akka-docs-dev/rst/java/stream-flows-and-basics.rst @@ -104,6 +104,11 @@ There are various ways to wire up different parts of a stream, the following exa .. includecode:: ../../../akka-samples/akka-docs-java-lambda/src/test/java/docs/stream/FlowDocTest.java#flow-connecting +Illegal stream elements +^^^^^^^^^^^^^^^^^^^^^^^ +In accordance to the Reactive Streams specification (`Rule 2.13 `_) +Akka Streams do not allow ``null`` to be passed through the stream as an element. In case you want to model the concept +of absence of a value we recommend using ``akka.japi.Option`` (for Java 6 and 7) or ``java.util.Optional`` which is available since Java 8. .. _back-pressure-explained-java: diff --git a/akka-docs-dev/rst/scala/stream-flows-and-basics.rst b/akka-docs-dev/rst/scala/stream-flows-and-basics.rst index b604e8f4a5..8d835ed922 100644 --- a/akka-docs-dev/rst/scala/stream-flows-and-basics.rst +++ b/akka-docs-dev/rst/scala/stream-flows-and-basics.rst @@ -108,6 +108,11 @@ There are various ways to wire up different parts of a stream, the following exa .. includecode:: code/docs/stream/FlowDocSpec.scala#flow-connecting +Illegal stream elements +^^^^^^^^^^^^^^^^^^^^^^^ +In accordance to the Reactive Streams specification (`Rule 2.13 `_) +Akka Streams do not allow ``null`` to be passed through the stream as an element. In case you want to model the concept +of absence of a value we recommend using ``scala.Option`` or ``scala.util.Either``. .. _back-pressure-explained-scala: