Hi,

I'm starting to learn the basics of Akka Streams, and I have this : 

final Source<Integer, NotUsed> source = Source.range(1, 100);
final Sink<X, CompletionStage<Done>> sink = Sink.foreach(v -> 
System.out.println(v));
final Flow<X, Integer, NotUsed> flow = Flow.fromSinkAndSource(sink, source);

What I'v read from the docs :

Flow
A processing stage which has *exactly one input and output*, which connects 
its up- and downstreams by transforming the data elements flowing through 
it.

If I understand correctly, I could transform an Integer to an X. A map on 
flow doesn't work, since that requires an Integer to be returned. I tried : 

Flow<X, X, NotUsed> x = flow.map(v -> return new X() );

but then I can't materialize the flow using runWith, since it requires both 
a sink and a source (why ?? Since fromSinkAndSource already provided that).

Can someone shed a light on this ?


Regards,


Igmar


-- 
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to