so actor stream integration always uses futures?

I am doing now:




Source<IncomingConnection, Future<ServerBinding>> serverSource =
      Http.get(system).bind("192.3.7.1", 8080 , materializer);
final Function<HttpRequest, Future<HttpResponse>> requestHandler =
      (request)->ask(actor, request, 1000l).mapTo(classTag(HttpResponse.class));




Future<ServerBinding> serverBindingFuture =
      serverSource.to(Sink.foreach(
            new Procedure<IncomingConnection>() {
              
               public void apply(IncomingConnection connection) throws 
Exception {
                  connection.handleWith(Flow.of(HttpRequest.class)
                        .mapAsync(4, requestHandler), materializer);
               }
            })).run(materializer);




Am Dienstag, 21. Juli 2015 12:00:51 UTC+2 schrieb Konrad Malawski:
>
> +1
>
> for
>
> mapAsync + ask 
>
> :-)
>
> -- 
> Cheers,
> Konrad 'ktoso’ Malawski
> Akka <http://akka.io> @ Typesafe <http://typesafe.com>
>
> On 21 July 2015 at 11:59:41, Viktor Klang ([email protected] 
> <javascript:>) wrote:
>
> mapAsync + ask?
>
> On Tue, Jul 21, 2015 at 11:53 AM, <[email protected] <javascript:>> 
> wrote:
>
>> In the  code example 
>> http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0/java/stream-io.html
>>  
>> <http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0/java/stream-io.html>
>> connection.handleWith(echo, mat);
>>
>> I would like a Actor to intercept the echo msg (maybe add a token to it)
>> How can this be done?
>>
>>
>>
>>  --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: 
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to the Google Groups 
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>  
>
>
> --
>    Cheers,
>  √
>   --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: 
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups 
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To post to this group, send email to [email protected] 
> <javascript:>.
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to