Materializer settings as attributes (#27499)

* Replace MaterializerSettings with Attributes #25559 
 * Field access to settings deprecated to make stages use attributes instead
 * Internal stages updated to use attributes
 * Docs on ActorMaterializerSettings updated to recommend away from using it
 * Verify all stages stopped after each testcase in FlowGroupBySpec
 * Subscription timeout attributes merged into one
This commit is contained in:
Johan Andrén 2019-09-04 13:37:06 +02:00 committed by GitHub
parent b9a879d722
commit aca63ea198
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
132 changed files with 1596 additions and 1116 deletions

View file

@ -32,14 +32,13 @@ class StreamBuffersRateSpec extends AkkaSpec {
}
"Demonstrate buffer sizes" in {
//#materializer-buffer
val materializer =
ActorMaterializer(ActorMaterializerSettings(system).withInputBuffer(initialSize = 64, maxSize = 64))
//#materializer-buffer
//#section-buffer
val section = Flow[Int].map(_ * 2).async.addAttributes(Attributes.inputBuffer(initial = 1, max = 1)) // the buffer size of this map is 1
val flow = section.via(Flow[Int].map(_ / 2)).async // the buffer size of this map is the default
val runnableGraph =
Source(1 to 10).via(flow).to(Sink.foreach(elem => println(elem)))
val withOverriddenDefaults = runnableGraph.withAttributes(Attributes.inputBuffer(initial = 64, max = 64))
//#section-buffer
}