!str #15950 Add runWith and remove toX
* runWith(drainWithKey) and runWith(tapWithKey) returning the materialized drain/tap * remove toPublisher, toSubscriber, and friends, in favor of using runWith * MaterializedMap is the return type for both flow and graph * Source[T] return type for Source.apply methods
This commit is contained in:
parent
dc4d121f48
commit
14d3501f92
50 changed files with 379 additions and 419 deletions
|
|
@ -26,7 +26,7 @@ class FlowMapAsyncUnorderedSpec extends AkkaSpec {
|
|||
val p = Source(1 to 4).mapAsyncUnordered(n ⇒ Future {
|
||||
Await.ready(latch(n), 5.seconds)
|
||||
n
|
||||
}).publishTo(c)
|
||||
}).connect(SubscriberDrain(c)).run()
|
||||
val sub = c.expectSubscription()
|
||||
sub.request(5)
|
||||
latch(2).countDown()
|
||||
|
|
@ -47,7 +47,7 @@ class FlowMapAsyncUnorderedSpec extends AkkaSpec {
|
|||
val p = Source(1 to 20).mapAsyncUnordered(n ⇒ Future {
|
||||
probe.ref ! n
|
||||
n
|
||||
}).publishTo(c)
|
||||
}).connect(SubscriberDrain(c)).run()
|
||||
val sub = c.expectSubscription()
|
||||
// nothing before requested
|
||||
probe.expectNoMsg(500.millis)
|
||||
|
|
@ -76,7 +76,7 @@ class FlowMapAsyncUnorderedSpec extends AkkaSpec {
|
|||
Await.ready(latch, 10.seconds)
|
||||
n
|
||||
}
|
||||
}).publishTo(c)
|
||||
}).connect(SubscriberDrain(c)).run()
|
||||
val sub = c.expectSubscription()
|
||||
sub.request(10)
|
||||
c.expectError.getMessage should be("err1")
|
||||
|
|
@ -95,7 +95,7 @@ class FlowMapAsyncUnorderedSpec extends AkkaSpec {
|
|||
n
|
||||
}
|
||||
}).
|
||||
publishTo(c)
|
||||
connect(SubscriberDrain(c)).run()
|
||||
val sub = c.expectSubscription()
|
||||
sub.request(10)
|
||||
c.expectError.getMessage should be("err2")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue