also fix FlowInterleaveSpec
Also-by: Johan Andrén <johan@markatta.com> Also-by: Roland Kuhn <rk@rkuhn.info> Also-by: Martynas Mickevičius <mmartynas@gmail.com>
This commit is contained in:
parent
ef77b56e66
commit
60497f6561
195 changed files with 1110 additions and 857 deletions
|
|
@ -3,6 +3,7 @@
|
|||
*/
|
||||
package docs.stream.javadsl.cookbook;
|
||||
|
||||
import akka.NotUsed;
|
||||
import akka.actor.*;
|
||||
import akka.dispatch.Mapper;
|
||||
import akka.japi.pf.ReceiveBuilder;
|
||||
|
|
@ -22,6 +23,7 @@ import scala.concurrent.duration.Duration;
|
|||
import scala.concurrent.duration.FiniteDuration;
|
||||
import scala.runtime.BoxedUnit;
|
||||
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
|
@ -142,9 +144,9 @@ public class RecipeGlobalRateLimit extends RecipeTest {
|
|||
public void work() throws Exception {
|
||||
new JavaTestKit(system) {
|
||||
//#global-limiter-flow
|
||||
public <T> Flow<T, T, BoxedUnit> limitGlobal(ActorRef limiter, FiniteDuration maxAllowedWait) {
|
||||
public <T> Flow<T, T, NotUsed> limitGlobal(ActorRef limiter, FiniteDuration maxAllowedWait) {
|
||||
final int parallelism = 4;
|
||||
final Flow<T, T, BoxedUnit> f = Flow.create();
|
||||
final Flow<T, T, NotUsed> f = Flow.create();
|
||||
|
||||
return f.mapAsync(parallelism, element -> {
|
||||
final Timeout triggerTimeout = new Timeout(maxAllowedWait);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue