[akka-user] Re: akka-streams how to chunk ordered stream based on common property efficiently

2015-03-20 Thread apiwoni
The more I think about it the more I realize that while this seems like an easy problem it may be difficult to solve with akka-streams. There does not seem to be a way to signal that last element has been received in order to create last chunk of elements with the same property. For example,

Re: [akka-user] akka-streams constructing Source from Iterator

2015-03-19 Thread apiwoni
Do you mind clarifying what you meant when you mentioned that signature for Source has been changed to take function that creates Iterator in order to share Source between various parts of code? Can this create iterator function be invoked more than once in the same runnable flow execution? If

[akka-user] akka-streams how to chunk ordered stream based on common property efficiently

2015-03-19 Thread apiwoni
Given a stream of elements E ordered by some property, how can I group these elements into List[E] as soon as all all elements with the same property are emitted. I want to continue processing each stream element, which now becomes List[E], as soon as possible. groupBy does not work in this

Re: [akka-user] akka-streams constructing Source from Iterator

2015-03-19 Thread apiwoni
Martynas, I have an existing function that creates Iterator that wraps ResultSet and I can pass this function to Source(f: () = Iterator) which would allow re-materialization. It makes sense though to execute query in hasNext as an optimization in case Iterator is never consumed. Given that I

[akka-user] akka-streams constructing Source from Iterator

2015-03-19 Thread apiwoni
I have been looking at akka-streams 0.7 and there used to be IteratorSource which could be used by passing Iterator. akka-streams 1.0-M4 no longer has IteratorSource but it has a Source object that takes function which produces an Iterator. Is main reason reason for this so that Iterator could

[akka-user] Deficiencies in actor testability?

2015-01-07 Thread apiwoni
The issue of testing business functionality that may be implemented in the class extending Actor has been raised quite a few times and I haven't found any good suggestions yet. Most Actor testing examples are focused around message receipt, type, timing etc. Akka team's response to this post