Re: [akka-user] [akka-streams] FlexiMerge/FlexiRoute parameters

2015-06-02 Thread Adam Warski


 I've been writing some simple code using FlexiMerge/FlexiRoute, and I'm 
 wondering why both have a single required OperationAttributes parameter? 
 Maybe there should be a * at the end to allow 0-* such parameters?


 You can combine attributes with the and combinator if you want to attach 
 more than one.


Can I attach 0? :)
 

 A side-question, I'm not really sure why this is so, but when I have a 
 Merge, I can just do:

 in ~ merge ~ out

 But when I have a FlexiMerge, I need to do:

 in ~ flexiMerge.in0
  flexiMerge.out ~ out

 it seems Merge's shape is also an Inlet, but I can't find that in the 
 code :)


 No, Merge has a shape of UniformFanIn. The sugared version of connecting 
 merge/broadcast only works because the DSL understands UniformFanin/Fanout 
 shapes, but it does not know about other shapes, since they can have 
 different types for each port (inlet/outlet). 


Ah! Now I have:

class SplitRoute[T](splitFn: T = Either[T, T]) extends FlexiRoute[T, 
UniformFanOutShape[T, T]](
  new UniformFanOutShape(2), OperationAttributes.name(SplitRoute)) { ... }

and I can use the nicer DSL.

Thanks,
Adam 

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] [akka-streams] FlexiMerge/FlexiRoute parameters

2015-06-01 Thread Akka Team
On Sat, May 23, 2015 at 1:37 PM, Adam Warski a...@warski.org wrote:

 Hello,

 I've been writing some simple code using FlexiMerge/FlexiRoute, and I'm
 wondering why both have a single required OperationAttributes parameter?
 Maybe there should be a * at the end to allow 0-* such parameters?


You can combine attributes with the and combinator if you want to attach
more than one.


 For lack of a better value, I'm currently using OperationAttributes.name,
 but that makes the code a bit noisy, as I already have to name the shape,
 e.g.:

 class SplitRoute[T](splitFn: T = Either[T, T]) extends FlexiRoute[T,
 FanOutShape2[T, T, T]](
   new FanOutShape2(SplitRoute), OperationAttributes.name(SplitRoute))
 { ... }


AFAIK there is a .named() convenience method that you can use on these
things (not in the class but when using the DSL). Also, you can import
OperationAttributes._, and then you can just call named(x) and ...



 A side-question, I'm not really sure why this is so, but when I have a
 Merge, I can just do:

 in ~ merge ~ out

 But when I have a FlexiMerge, I need to do:

 in ~ flexiMerge.in0
  flexiMerge.out ~ out

 it seems Merge's shape is also an Inlet, but I can't find that in the code
 :)


No, Merge has a shape of UniformFanIn. The sugared version of connecting
merge/broadcast only works because the DSL understands UniformFanin/Fanout
shapes, but it does not know about other shapes, since they can have
different types for each port (inlet/outlet).

-Endre



 --
 Thanks,
 Adam

 --
  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 http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




-- 
Akka Team
Typesafe - Reactive apps on the JVM
Blog: letitcrash.com
Twitter: @akkateam

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] [akka-streams] FlexiMerge/FlexiRoute parameters

2015-05-23 Thread Adam Warski
Hello,

I've been writing some simple code using FlexiMerge/FlexiRoute, and I'm 
wondering why both have a single required OperationAttributes parameter? 
Maybe there should be a * at the end to allow 0-* such parameters?
For lack of a better value, I'm currently using OperationAttributes.name, 
but that makes the code a bit noisy, as I already have to name the shape, 
e.g.:

class SplitRoute[T](splitFn: T = Either[T, T]) extends FlexiRoute[T, 
FanOutShape2[T, T, T]](
  new FanOutShape2(SplitRoute), OperationAttributes.name(SplitRoute)) { 
... }

A side-question, I'm not really sure why this is so, but when I have a 
Merge, I can just do:

in ~ merge ~ out

But when I have a FlexiMerge, I need to do:

in ~ flexiMerge.in0
 flexiMerge.out ~ out

it seems Merge's shape is also an Inlet, but I can't find that in the code 
:)

-- 
Thanks,
Adam

-- 
  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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.