diff --git a/akka-docs-dev/rst/scala/code/docs/stream/io/StreamFileDocSpec.scala b/akka-docs-dev/rst/scala/code/docs/stream/io/StreamFileDocSpec.scala index 44d505b4fc..d297c3cba3 100644 --- a/akka-docs-dev/rst/scala/code/docs/stream/io/StreamFileDocSpec.scala +++ b/akka-docs-dev/rst/scala/code/docs/stream/io/StreamFileDocSpec.scala @@ -6,10 +6,12 @@ package docs.stream.io import java.io.File import akka.stream._ -import akka.stream.io.SynchronousFileSource import akka.stream.io.SynchronousFileSink -import akka.stream.testkit._ +import akka.stream.io.SynchronousFileSource +import akka.stream.scaladsl.Sink +import akka.stream.scaladsl.Source import akka.stream.testkit.Utils._ +import akka.stream.testkit._ import akka.util.ByteString class StreamFileDocSpec extends AkkaSpec(UnboundedMailboxConfig) { @@ -54,4 +56,12 @@ class StreamFileDocSpec extends AkkaSpec(UnboundedMailboxConfig) { .withAttributes(ActorOperationAttributes.dispatcher("custom-file-io-dispatcher")) //#custom-dispatcher-code } + + "show Implicits" in { + //#source-sink-implicits + import akka.stream.io.Implicits._ + + Source.synchronousFile(file) to Sink.outputStream(() ⇒ System.out) + //#source-sink-implicits + } } diff --git a/akka-docs-dev/rst/scala/stream-io.rst b/akka-docs-dev/rst/scala/stream-io.rst index 1df2916927..3328625e0e 100644 --- a/akka-docs-dev/rst/scala/stream-io.rst +++ b/akka-docs-dev/rst/scala/stream-io.rst @@ -121,3 +121,9 @@ dispatcher for file IO operations globally, you can do so by changing the ``akka or for a specific stage by spefifying a custom Dispatcher in code, like this: .. includecode:: code/docs/stream/io/StreamFileDocSpec.scala#custom-dispatcher-code + +If you would like to keep all sink and source factories defined on the :class:`Source` and :class:`Sink` objects +instead of using the separate objects contained in ``akka.strea.io`` to create these you can import an *implicit +coversion* that makes these operations available as shown below: + +.. includecode:: code/docs/stream/io/StreamFileDocSpec.scala#source-sink-implicits