reactor-core icon indicating copy to clipboard operation
reactor-core copied to clipboard

Feature/3340 Add best-effort replay sink

Open MikkelHJuul opened this issue 1 year ago • 2 comments

This PR adds the ArraySizeBoundReplayBuffer, and links it for the user via Sink.many().replay().bestEffort().

This new spec offer support for the purely size-bound buffer implementations. It adds #limit(n), #latest() and #latestOrDefault(T), reflecting the same methods from its parent, Sink.many().replay(). The ArraySizeBoundReplayBuffer in contrast to the SizeBoundReplayBuffer will never hold more than the stated items referenced. The SizeBoundReplayBuffer, through the Subscription, will retain old references, such that they can be replayed to the subscriber. This is very correct, but can also make the buffer grow beyond its bounds, if a subscriber lacks request they will still be able to replay all elements, but these elements remain in memory. The ArraySizeBoundReplayBuffer hold and replay only what is kept in the array.

Fixes issues/3340

MikkelHJuul avatar Apr 28 '24 05:04 MikkelHJuul

I still need a few tests to document this further

MikkelHJuul avatar Apr 28 '24 05:04 MikkelHJuul

I'm having pipeline issues with gradle on M1 Mac, so I'm stuck

MikkelHJuul avatar May 06 '24 18:05 MikkelHJuul

Closing as explained in https://github.com/reactor/reactor-core/issues/3340#issuecomment-2242821598.

chemicL avatar Jul 22 '24 12:07 chemicL