deduplicate logic for IODispatcher #24604 (#24619)

* deduplicate logic for IODispatcher #24604
 * introduce a resolveDispatcher helper in ActorAttributes
 * mention akka.stream.materializer.blocking-io-dispatcher instead of akka.stream.blocking-io-dispatcher in scaladocs
 * fix a flaky test
 * cosmetic changes in the touched files

* move resolveDispather helper to the Dispatcher companion object under a new name resolve

* filter out mima warning

* fix mima excludes after the 2.5.11 release

* address review comments
 * update stream-io.md with the correct dispatcher config key
 * mark ActorAttributes.Dispatcher#resolve as internal API
 * use the dispatche config key in ActorMaterializer

* add private[akka] to the resolve methods
This commit is contained in:
Roman Filonenko 2018-03-07 15:12:34 +01:00 committed by Patrik Nordwall
parent a13f5cab00
commit 0ecadf7235
17 changed files with 127 additions and 111 deletions

View file

@ -76,7 +76,7 @@ object ActorMaterializer {
}
/**
* Scala API: * Scala API: Creates an ActorMaterializer that can materialize stream blueprints as running streams.
* Scala API: Creates an ActorMaterializer that can materialize stream blueprints as running streams.
*
* The required [[akka.actor.ActorRefFactory]]
* (which can be either an [[akka.actor.ActorSystem]] or an [[akka.actor.ActorContext]])
@ -255,13 +255,13 @@ object ActorMaterializerSettings {
fuzzingMode: Boolean,
autoFusing: Boolean,
maxFixedBufferSize: Int) = {
// these sins were comitted in the name of bin comp:
// these sins were committed in the name of bin comp:
val config = ConfigFactory.defaultReference
new ActorMaterializerSettings(
initialInputBufferSize, maxInputBufferSize, dispatcher, supervisionDecider, subscriptionTimeoutSettings, debugLogging,
outputBurstLimit, fuzzingMode, autoFusing, maxFixedBufferSize, 1000, IOSettings(tcpWriteBufferSize = 16 * 1024),
StreamRefSettings(config.getConfig("akka.stream.materializer.stream-ref")),
config.getString("akka.stream.blocking-io-dispatcher")
config.getString(ActorAttributes.IODispatcher.dispatcher)
)
}
@ -307,13 +307,13 @@ object ActorMaterializerSettings {
fuzzingMode: Boolean,
autoFusing: Boolean,
maxFixedBufferSize: Int) = {
// these sins were comitted in the name of bin comp:
// these sins were committed in the name of bin comp:
val config = ConfigFactory.defaultReference
new ActorMaterializerSettings(
initialInputBufferSize, maxInputBufferSize, dispatcher, supervisionDecider, subscriptionTimeoutSettings, debugLogging,
outputBurstLimit, fuzzingMode, autoFusing, maxFixedBufferSize, 1000, IOSettings(tcpWriteBufferSize = 16 * 1024),
StreamRefSettings(config.getConfig("akka.stream.materializer.stream-ref")),
config.getString("akka.stream.blocking-io-dispatcher"))
config.getString(ActorAttributes.IODispatcher.dispatcher))
}
/**
@ -383,7 +383,7 @@ final class ActorMaterializerSettings @InternalApi private (
this(initialInputBufferSize, maxInputBufferSize, dispatcher, supervisionDecider, subscriptionTimeoutSettings, debugLogging,
outputBurstLimit, fuzzingMode, autoFusing, maxFixedBufferSize, syncProcessingLimit, ioSettings,
StreamRefSettings(ConfigFactory.defaultReference().getConfig("akka.stream.materializer.stream-ref")),
ConfigFactory.defaultReference().getString("akka.stream.blocking-io-dispatcher")
ConfigFactory.defaultReference().getString(ActorAttributes.IODispatcher.dispatcher)
)
// backwards compatibility when added IOSettings, shouldn't be needed since private, but added to satisfy mima
@ -404,7 +404,7 @@ final class ActorMaterializerSettings @InternalApi private (
this(initialInputBufferSize, maxInputBufferSize, dispatcher, supervisionDecider, subscriptionTimeoutSettings, debugLogging,
outputBurstLimit, fuzzingMode, autoFusing, maxFixedBufferSize, syncProcessingLimit,
IOSettings(tcpWriteBufferSize = 16 * 1024), StreamRefSettings(ConfigFactory.defaultReference().getConfig("akka.stream.materializer.stream-ref")),
ConfigFactory.defaultReference().getString("akka.stream.blocking-io-dispatcher")
ConfigFactory.defaultReference().getString(ActorAttributes.IODispatcher.dispatcher)
)
// backwards compatibility when added IOSettings, shouldn't be needed since private, but added to satisfy mima
@ -424,7 +424,7 @@ final class ActorMaterializerSettings @InternalApi private (
this(initialInputBufferSize, maxInputBufferSize, dispatcher, supervisionDecider, subscriptionTimeoutSettings, debugLogging,
outputBurstLimit, fuzzingMode, autoFusing, maxFixedBufferSize, 1000, IOSettings(tcpWriteBufferSize = 16 * 1024),
StreamRefSettings(ConfigFactory.defaultReference().getConfig("akka.stream.materializer.stream-ref")),
ConfigFactory.defaultReference().getString("akka.stream.blocking-io-dispatcher")
ConfigFactory.defaultReference().getString(ActorAttributes.IODispatcher.dispatcher)
)
private def copy(