Hi Joost,
On Wed, Mar 4, 2015 at 8:26 AM, Joost den Boer <[email protected]> wrote: > Hi, > > I am trying to get the hang of Akka Streams and have been struggling last > night with some of the examples in the Streams documentation because of > this api change. It would be great if the documentation could be updated so > other newbies don't get stuck like me. > We did update the samples (at least they compile ;) ), and added this section, too: http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0-M4/scala/stream-flows-and-basics.html#Combining_materialized_values Is something that you think is missing? > > Thanks for your reply. It pointed me in the right direction. > I understand the need for the materialized type, but I do not understand > why the default value is to return the materialized value of the Source > instead of the Sink. > We have lots of tests that we had to port, and we tried various defaults -- they all suck :) We chose this one at the end, but the others had also warts. If you want the mat type of the sink you can always use runWith which returns the materialized element of the sink. -Endre It seems more logic to me that you want the result of the Sink. Could you > give an example of when you would be interested in the materialized value > of the Source? > > Regards, > Joost > > > On Tuesday, March 3, 2015 at 4:15:50 PM UTC+1, Björn Antonsson wrote: >> >> Hi Giovanni, >> >> 1) The type needs to exist somewhere, and if your code doesn't care about >> it, you can accept a Source[T, _] >> 2) For consistency, one of the sides where chosen, and it's not that >> uncomon that you are interested in the materialized value of the Source. If >> you are interested in the materialized value of the Sink, you should add >> the Sink with runWith instead. A more complete overview is available here >> <http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0-M4/scala/stream-flows-and-basics.html#Combining_materialized_values> >> . >> >> B/ >> >> On 2 March 2015 at 22:54:53, Giovanni Alberto Caporaletti ( >> [email protected]) wrote: >> >> I'm trying to better understand the new api. If I got it right, the new >> type parameter of the various stream components represents the type of >> what's materialized by that component when the stream is run >> (materialized). E.g.: A Source(actorProducerProps) has the actorRef as its >> "materialization". >> >> Now I have two questions: >> 1) In which cases could it be useful to know the materialization type of >> intermediate components? I mean, as a stream "consumer" (i.e. client, in a >> generic sense), if someone gives me a Source[T,M], I should only know that >> it produces T elements, the M type looks like implementation detail. What >> am I missing? >> 2) Why does .to default to Keep.left? Aren't we almost always interested >> in the materialized result of Sinks (right)? I see a lot of [T, Unit] >> around. >> >> >> >> Thanks! >> G >> -- >> >>>>>>>>>> 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. >> >> -- >> Björn Antonsson >> Typesafe Inc. <http://typesafe.com> – Reactive Apps on the JVM >> twitter: bantonsson <http://twitter.com/bantonsson> >> >> JOIN US. REGISTER TODAY! >> <http://event.scaladays.org/scaladays-sanfran-2015> >> Scala <http://event.scaladays.org/scaladays-sanfran-2015> >> Days <http://event.scaladays.org/scaladays-sanfran-2015> >> March 16th-18th, <http://event.scaladays.org/scaladays-sanfran-2015> >> San Francisco <http://event.scaladays.org/scaladays-sanfran-2015> >> > -- > >>>>>>>>>> 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. > -- >>>>>>>>>> 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.
