These are chat archives for akkadotnet/AkkaStreams

16th
Jun 2017
Aaron Ford
@aaronjamesford
Jun 16 2017 10:41
Hi guys, we have what I guess is a fairly uncommon use case for the GroupBy operator. We have a stream that exists for the lifetime of the program & grouping on a key. A given key should be periodic and may come in & out of existence over time but as it stands we are exceeding the max group size. Is there any way to get GroupBy to terminate & reuse a subflow/key after some period of idleness?
Marc Piechura
@marcpiechura
Jun 16 2017 11:11
@aaronjamesford I'm not 100% sure but maybe you can put a KillSwitch after the GroupBy operator and use this to shutdown the sub streams, because in general cancelling substreams should work
the other approach would be to use a BroadcastHub and use this to add/remove grouping streams at runtime
Marc Piechura
@marcpiechura
Jun 16 2017 11:18
or maybe even simpler :)
there is a IdleTimeout operator
but keep in mind that once a substream is closed for a given key new elements with this specific key are ignored
Aaron Ford
@aaronjamesford
Jun 16 2017 12:08
Yeah, I've tried that. But we would need for the stream to be recreated if the key comes up again
I shall look into the Killswitch/BroadcastHub approach. Thanks :)
Marc Piechura
@marcpiechura
Jun 16 2017 13:31
then the Killswitch will not work either, it does the same as IdleTimeout in terms of recreated keys, so BroadcastHub it is then