StormByte-Buffer 4.0.0
C++26 buffer module of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Buffer::AdmissionWaitObserver Struct Reference

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.

Detailed Description

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.

Member Data Documentation

◆ Changed

void(* StormByte::Buffer::AdmissionWaitObserver::Changed) (void *, AdmissionWaitReason, bool entering) noexcept = nullptr
noexcept

Wait transition.

◆ Context

void* StormByte::Buffer::AdmissionWaitObserver::Context = nullptr

Borrowed callback context.


The documentation for this struct was generated from the following file: