#19522 make javadsl.Sink.asPublisher nicer

This commit is contained in:
Roland Kuhn 2016-01-20 21:01:27 +01:00
parent b1351b36ed
commit 9427052fd0
12 changed files with 43 additions and 12 deletions

View file

@ -73,3 +73,15 @@ In Akka 2.4.x this is formulated like so:
.. includecode:: ../code/docs/stream/MigrationsJava.java#expand-state
Changed Sinks
=============
Sink.asPublisher is now configured using an enum
------------------------------------------------
In order to not use a meaningless boolean parameter we have changed the signature to:
.. includecode:: ../code/docs/stream/MigrationsJava.java#asPublisher-import
.. includecode:: ../code/docs/stream/MigrationsJava.java#asPublisher

View file

@ -108,7 +108,7 @@ This is how it can be used as input :class:`Source` to a :class:`Flow`:
.. includecode:: ../code/docs/stream/ActorPublisherDocTest.java#actor-publisher-usage
You can only attach one subscriber to this publisher. Use a ``Broadcast``-element or
attach a ``Sink.asPublisher(true)`` to enable multiple subscribers.
attach a ``Sink.asPublisher(AsPublisher.WITH_FANOUT)`` to enable multiple subscribers.
ActorSubscriber
^^^^^^^^^^^^^^^
@ -414,7 +414,7 @@ by using the Publisher-:class:`Sink`:
.. includecode:: ../code/docs/stream/ReactiveStreamsDocTest.java#source-publisher
A publisher that is created with ``Sink.asPublisher(false)`` supports only a single subscription.
A publisher that is created with ``Sink.asPublisher(AsPublisher.WITHOUT_FANOUT)`` supports only a single subscription.
Additional subscription attempts will be rejected with an :class:`IllegalStateException`.
A publisher that supports multiple subscribers using fan-out/broadcasting is created as follows: