Closed MikkelHJuul closed 2 months ago
I still need a few tests to document this further
I'm having pipeline issues with gradle on M1 Mac, so I'm stuck
Closing as explained in https://github.com/reactor/reactor-core/issues/3340#issuecomment-2242821598.
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()
. TheArraySizeBoundReplayBuffer
in contrast to theSizeBoundReplayBuffer
will never hold more than the stated items referenced. TheSizeBoundReplayBuffer
, through theSubscription
, 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. TheArraySizeBoundReplayBuffer
hold and replay only what is kept in the array.Fixes issues/3340