core-async

2021-06-10T00:21:45.019200Z

What about something like https://github.com/cgrand/xforms/blob/62375212a8604daad631c9024e9dbe1db4ec276b/src/net/cgrand/xforms.cljc#L585 where time is determined from the item being passed? You could also use reductions in that library to build up a vector until one of your two conditions is met

2021-06-10T05:24:40.019500Z

^ hard to grasp my head around this. “where time is determined from the item being passed” — if nothing comes, then who triggers the time :thinking_face: e.g. N=5 and TS=1000ms, we buffered 3 elements so far and nothing comes in now and TS passed as per the last 3 element is below 1000ms

2021-06-10T05:26:57.019800Z

i could be wrong. the xforms library had already gone above my head because of my weak understanding of the transducers mental model