Skip to content

v0.0.1

Latest

Choose a tag to compare

@tklauser tklauser released this 09 Apr 07:24
sinks: Add ToTruncatingChannel

ToTruncatingChannel works just like ToChannel, but also decouple the
observer from the consumer.  In order to do so, an additional goroutine,
in charge of pulling the items from the source observable and store the
last one in a local buffer, is started and managed internally. This
allows to never block the source observable.

This is particularly useful in case of a slow observer where it is safe
to lose "intermediate" items while still busy handling a previous one.

Signed-off-by: Fabio Falzoi <fabio.falzoi84@gmail.com>