Borrowed, allocation-free observer for one synchronous PushFor call. More...
#include <StormByte/buffer/byte_budget.hxx>
Public Attributes | |
| void * | Context = nullptr |
| Borrowed callback context. | |
| void(* | Changed )(void *, AdmissionWaitReason, bool entering) noexcept = nullptr |
| Wait transition. | |
Borrowed, allocation-free observer for one synchronous PushFor call.
Changed runs on the calling thread, outside all Buffer locks, immediately before each actual budget wait (entering=true) and after it returns (entering=false), with the same reason. LocalCapacity takes precedence when both local and shared capacity are unavailable. A wake can cause a new attempt and another pair, possibly with a different reason; an event already signalled can make the wait return immediately. Fast paths and attempts that never reach a wait produce no callbacks.
Context and callback must remain valid until PushFor returns; neither is owned or retained. Callbacks must not throw, should be brief, and may safely inspect queue/budget snapshots. Shared contexts need caller-owned synchronization when used concurrently. A null Changed disables observing.
|
noexcept |
Wait transition.
| void* StormByte::Buffer::AdmissionWaitObserver::Context = nullptr |
Borrowed callback context.