Thread-safe credit ledger; final page/worker release may happen on any thread.
More...
#include <source_budget.hpp>
|
| static constexpr std::size_t | ROOT_METADATA_BYTES |
| | Bootstrap ledger allowance, retained for the root lifetime.
|
|
static constexpr std::size_t | CAPACITY_OBSERVER_BYTES = 4096 |
| | Precharged allowance for one capacity observer.
|
|
|
class | SourceCredit |
|
class | SourceCapacityObserver |
|
struct | detail::SourceCapacityState |
Thread-safe credit ledger; final page/worker release may happen on any thread.
◆ capacityEpoch()
| std::uint64_t portals::SourceBudget::capacityEpoch |
( |
| ) |
const |
|
noexcept |
- Returns
- Advisory release generation; only capacity notifications, never byte identities, use this value.
◆ create()
- Parameters
-
| options | Positive capacity limits; includes a conservative bootstrap allowance. |
- Returns
- New root or INVALID_ARGUMENT/NO_MEMORY.
◆ observeCapacity()
| std::expected< SourceCapacityObserver, SourceError > portals::SourceBudget::observeCapacity |
( |
Publisher< int > | wake | ) |
|
- Parameters
-
| wake | Worker-safe wake-only endpoint; no payload or UI callback is invoked by release. |
- Returns
- Precharged4KiB RAII registration, bounded by maxConsumers, or a typed admission failure.
◆ options()
- Returns
- Immutable root limits.
◆ reserve()
- Parameters
-
| amount | Capacities to reserve atomically before allocation or I/O. |
- Returns
- Owning credit, or WOULD_BLOCK without changing any counter.
◆ usage()
- Returns
- One synchronized aggregate snapshot.
◆ ROOT_METADATA_BYTES
| std::size_t portals::SourceBudget::ROOT_METADATA_BYTES |
|
staticconstexpr |
Initial value:
Bootstrap ledger allowance, retained for the root lifetime.
The documentation for this class was generated from the following file: