scalus.cardano.node.stream.DeltaBufferPolicy
See theDeltaBufferPolicy companion object
enum DeltaBufferPolicy
Overflow behaviour for a delta buffer.
There is no backpressure to be had here, and that is a property of the source rather than of this implementation: a chain produces blocks whether or not anyone is keeping up, so the only decisions available are how much to hold and what to do when that is not enough.
Chain-sourced events must never be dropped silently — a missed Spent corrupts the subscriber's view of state permanently, and it has no way to notice. So the two options are "never drop" and "fail loudly":
Bounded(n)— on overflow the subscription terminates with scalus.cardano.infra.ScalusBufferOverflowException, so the subscriber knows its view is untrustworthy and must resync. Default, see DeltaBufferPolicy.default.Unbounded— memory is the only bound. For a subscriber that would rather be killed by the OOM killer than resync.
Deliberately not offered: a bounded buffer that drops. It would turn the corruption this policy exists to prevent into the default behaviour, and the subscriber could not detect it.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Members list
In this article