These are chat archives for akkadotnet/AkkaStreams

14th
Nov 2016
Sean Farrow
@SeanFarrow
Nov 14 2016 06:10
Has anyone written a queue stage using AkkaStreams. I've got this as an actor currently, but would be looking to turn this in to a stream-based implementation. Any pointers appreciated. I was thinking of using BidiFlow, but I can't find any examples.
Marc Piechura
@marcpiechura
Nov 14 2016 06:13
We have Source.Queue
Sean Farrow
@SeanFarrow
Nov 14 2016 07:15
Is this bidirectional? I need to be able to push from one scream and pop from another
Marc Piechura
@marcpiechura
Nov 14 2016 07:49
So you want to connect two streams via queue?
Sean Farrow
@SeanFarrow
Nov 14 2016 07:51
Yes, I've got one scream but can push to the queue if it can't publish somewhere else, and another stream that needs to read from the queue when certain things happen!
Marc Piechura
@marcpiechura
Nov 14 2016 07:57
Is the reason that your source stream maybe is faster as the second stream and you want to buffer messages so that the source stream can continue or do you want to create the second stream dynamical at runtime and then take the query ?
Sean Farrow
@SeanFarrow
Nov 14 2016 08:00
The source stream is dependent on an external connection actually being connected, if the connection drops, then the message we are trying to publish is placed in the queue. Currently this is all done with actors quite nicely, but I'd like to move this to streams where possible!
Marc Piechura
@marcpiechura
Nov 14 2016 08:12
I don't think we have a build in stage for it, but I think you could model it as a graph, input -> mergeIn1 -> SelectAsync ( wrap the task in some kind of result value ) -> filter1 (result success) -> output
Filter2 ( result failure, connection lost ) -> Buffer or ConfalteWithSeed -> mergeIn2 (this goes back to the beginning and is retried later)
Don't have time to draw it but I hope you get the idea ;)
Sean Farrow
@SeanFarrow
Nov 14 2016 08:21
I get the idea, let me go and have a look at that as it might be quite a bit of work but worth doing!