Actually use the relative blocking io dispatcher setting #24357
* Remove docs and have only deprecation comment on old setting * ConfigFactory.load fixed
This commit is contained in:
parent
89d5b5d00e
commit
fd6f30673a
14 changed files with 187 additions and 51 deletions
|
|
@ -10,7 +10,9 @@ import java.nio.file.{ Files, NoSuchFileException, Path, StandardOpenOption }
|
|||
|
||||
import akka.Done
|
||||
import akka.annotation.InternalApi
|
||||
import akka.stream.ActorAttributes.Dispatcher
|
||||
import akka.stream.Attributes.InputBuffer
|
||||
import akka.stream.impl.Stages.DefaultAttributes.IODispatcher
|
||||
import akka.stream.impl.{ ErrorPublisher, SourceModule }
|
||||
import akka.stream.stage._
|
||||
import akka.stream.{ IOResult, _ }
|
||||
|
|
@ -153,7 +155,12 @@ private[akka] final class FileSource(path: Path, chunkSize: Int, startPosition:
|
|||
val pub = try {
|
||||
val is = createInputStream() // can throw, i.e. FileNotFound
|
||||
|
||||
val props = InputStreamPublisher.props(is, ioResultPromise, chunkSize)
|
||||
val dispatcher = context.effectiveAttributes.mandatoryAttribute[Dispatcher] match {
|
||||
case IODispatcher ⇒ ActorMaterializerHelper.downcast(context.materializer).settings.blockingIoDispatcher
|
||||
case Dispatcher(name) ⇒ name
|
||||
}
|
||||
|
||||
val props = InputStreamPublisher.props(is, ioResultPromise, chunkSize).withDispatcher(dispatcher)
|
||||
|
||||
val ref = materializer.actorOf(context, props)
|
||||
akka.stream.actor.ActorPublisher[ByteString](ref)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue