Gentlemen,

I've devoted some time to creating a stand-alone library for acknowledged 
streams using BidiFlow, as was recommended by Victor. The repository can be 
found here: https://github.com/timcharper/acked-stream 
<https://github.com/timcharper/acked-stream/blob/master/src/main/scala/acked/stream/AckedFlow.scala#L36>.
 I'm 
finding the implementation to be significantly more involved than the 
Promise based solution, although the complexity should be manageable (and, 
there are some clear benefits, such as the ability to apply back-pressure 
if acknowledgement is running slow, or cross a process boundary).

One issue I'm having right away is respecting the materializer settings. 
>From a public standpoint, it would seem that all access to materialized / 
fused operations are blocked, and I have no way to access the provided 
SupervisorStrategy. This means that the custom PushPullStage I've 
implemented for the map / filter / collect operations don't respect it. See 
https://github.com/timcharper/acked-stream/blob/master/src/main/scala/acked/stream/AckedFlow.scala#L36
.

Another issue: mapConcat will either filter a message or split it up into 
multiple elements. I need the coordinating acknowledgment channel for the 
mapConcat node to wait to see a set of acknowledgements before it pushes 
it's acknowledgment upstream. The public API does not appear to have any 
option to instantiate a pair of stages whose instances are aware of each 
other.

Given the latter limitation, I may need to introduce a graph at each node 
which routes messages directly to the acknowledger, and then use a FanIn at 
that node which prefers those messages, a. la.:
 
filter    mapConcat    sink
+------+   +------+   +------+
|      |   |      |   |      |
<-ack--<...<-ack--<...<---\  |
|  \   |   |  \   |   |   |  |
|   |  |   |   |  |   |   |  |
|  /   |   |  /   |   |   |  |
>-data->...>-data->...>---/  |
|      |   |      |   |      |
+------+   +------+   +------+


Although, my preference is this type of a setup, as then it is at least 
possible to have ordered acknowledgements. (although, granted, this is the 
scenario that is giving the most grief).

 filter    junction   mapConcat    sink
+------+   +------+   +------+   +------+
|      |   |      |   |      |   |      |
<-ack--<...<--\---<...<-ack--<...<---\  |
|      |   |   |  |   |      |   |   |  |
|      |   |   ^  |   |      |   |   |  |
|      |   |   |  |   |      |   |   |  |
>-data->...>--/--->...>-data->...>---/  |
|      |   |      |   |      |   |      |
+------+   +------+   +------+   +------+


Tim

-- 
>>>>>>>>>>      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