add java.time.Duration support for javadsl #24646

* add java.time.Duration support for askWithReplyto methods and add deprecated to method with akka Timeout as parameter type
This commit is contained in:
Guy Youansi 2018-06-27 01:12:11 +02:00 committed by Patrik Nordwall
parent b9aecb7f5a
commit eb5885e94e
5 changed files with 95 additions and 9 deletions

View file

@ -149,9 +149,8 @@ public class RecipeGlobalRateLimit extends RecipeTest {
final Flow<T, T, NotUsed> f = Flow.create();
return f.mapAsync(parallelism, element -> {
final Timeout triggerTimeout = Timeout.create(maxAllowedWait);
final CompletionStage<Object> limiterTriggerFuture =
PatternsCS.ask(limiter, Limiter.WANT_TO_PASS, triggerTimeout);
PatternsCS.ask(limiter, Limiter.WANT_TO_PASS, maxAllowedWait);
return limiterTriggerFuture.thenApplyAsync(response -> element, system.dispatcher());
});
}