Indeed, but also the possibility of creating user define vertices is quite
useful. Right now I have a scala Either, but in others projects we are
using scalaz Either instead, as it's right biased.

For now what I'm doing is something like this,

FlowGraph { implicit builder =>
  val broadcast: Broadcast[Either[A, B]] = ...

  source ~> broadcast

  broadcast ~> LeftFlow
  broadcast ~> RightFlow
}

LeftFlow and RightFlow are flows that use transform with this helper Filter
to to work on the left or right side:

final class DisjunctionFilter[A, B] {
> object left extends Transformer[Either[A, B], A] {
> override def onNext(element: Either[A, B]): Seq[A] =
> element.fold(Seq[A](_), _ => Seq[A]())
> }
>
> object right extends Transformer[Either[A, B], B] {
> override def onNext(element: Either[A, B]): Seq[B] =
> element.fold(_ => Seq[B](), Seq[B](_))
> }
> }
>

2014-11-03 12:36 GMT+00:00 Olli Helenius <[email protected]>:

> Seems like such a vertex would be quite useful even as a built-in in
> akka-stream.
>
> --
> >>>>>>>>>> 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.

Reply via email to