!str - 18916 - Source.file and Sink.file
* Removes `Synchronous` from the names and descriptions of File I/O as it leaks impl details * Removes the factries for FileSource and FileSink and puts them in Source and Sink respectively
This commit is contained in:
parent
7d4304fc6e
commit
20c996fe41
31 changed files with 262 additions and 242 deletions
|
|
@ -6,8 +6,6 @@ package docs.stream.io
|
|||
import java.io.File
|
||||
|
||||
import akka.stream._
|
||||
import akka.stream.io.SynchronousFileSink
|
||||
import akka.stream.io.SynchronousFileSource
|
||||
import akka.stream.scaladsl.Sink
|
||||
import akka.stream.scaladsl.Source
|
||||
import akka.stream.testkit.Utils._
|
||||
|
|
@ -48,7 +46,7 @@ class StreamFileDocSpec extends AkkaSpec(UnboundedMailboxConfig) {
|
|||
|
||||
//#file-source
|
||||
|
||||
val foreach: Future[Long] = SynchronousFileSource(file)
|
||||
val foreach: Future[Long] = Source.file(file)
|
||||
.to(Sink.ignore)
|
||||
.run()
|
||||
//#file-source
|
||||
|
|
@ -56,16 +54,8 @@ class StreamFileDocSpec extends AkkaSpec(UnboundedMailboxConfig) {
|
|||
|
||||
"configure dispatcher in code" in {
|
||||
//#custom-dispatcher-code
|
||||
SynchronousFileSink(file)
|
||||
Sink.file(file)
|
||||
.withAttributes(ActorAttributes.dispatcher("custom-blocking-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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue