Fix snippet example in stream-rate doc #21006
Fix #section-buffer by replacing .withAttributes by .addAttributes to avoid overwriting the .async option. * Update StreamBuffersRateDocTest.java Fix #section-buffer by replacing .withAttributes by .addAttributes to avoid overwriting the .async option.
This commit is contained in:
parent
210c11e85e
commit
c8dfa2458d
2 changed files with 2 additions and 2 deletions
|
|
@ -65,7 +65,7 @@ public class StreamBuffersRateDocTest extends AbstractJavaTest {
|
|||
final Flow<Integer, Integer, NotUsed> flow1 =
|
||||
Flow.of(Integer.class)
|
||||
.map(elem -> elem * 2).async()
|
||||
.withAttributes(Attributes.inputBuffer(1, 1)); // the buffer size of this map is 1
|
||||
.addAttributes(Attributes.inputBuffer(1, 1)); // the buffer size of this map is 1
|
||||
final Flow<Integer, Integer, NotUsed> flow2 =
|
||||
flow1.via(
|
||||
Flow.of(Integer.class)
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class StreamBuffersRateSpec extends AkkaSpec {
|
|||
|
||||
//#section-buffer
|
||||
val section = Flow[Int].map(_ * 2).async
|
||||
.withAttributes(Attributes.inputBuffer(initial = 1, max = 1)) // the buffer size of this map is 1
|
||||
.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
|
||||
//#section-buffer
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue