That is a know issue <https://github.com/akka/akka/issues/15892> in scaladsl2 in version 0.7 and 0.8. It is fixed in upcoming 0.9.
You can probably work around it by using an Iterator instead. /Patrik On Mon, Oct 6, 2014 at 5:51 PM, Boris Lopukhov <[email protected]> wrote: > Hello, > > I wrote this code: > > import akka.actor.ActorSystem > import akka.stream.scaladsl2.BlackholeSink > import akka.stream.scaladsl2.FlowFrom > import akka.stream.scaladsl2.FlowMaterializer > import akka.stream.scaladsl2.ThunkSource > > > object Main extends App { > > implicit val system = ActorSystem() > implicit val flowMaterializer = FlowMaterializer() > > FlowFrom[Int] > .withSource(ThunkSource(() => Some(1))) > .map(x => x) > .withSink(BlackholeSink) > .run > } > > And then got this error: java.lang.ClassCastException: scala.Some cannot > be cast to java.lang.Integer > > What i'm doing wrong? //Akka-stream version - 0.7 > > -- > >>>>>>>>>> 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. > -- Patrik Nordwall Typesafe <http://typesafe.com/> - Reactive apps on the JVM Twitter: @patriknw -- >>>>>>>>>> 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.
