EnvelopeFlow.Throttling 0.1.0-alpha.3.1

This is a prerelease version of EnvelopeFlow.Throttling.
dotnet add package EnvelopeFlow.Throttling --version 0.1.0-alpha.3.1
                    
NuGet\Install-Package EnvelopeFlow.Throttling -Version 0.1.0-alpha.3.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EnvelopeFlow.Throttling" Version="0.1.0-alpha.3.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EnvelopeFlow.Throttling" Version="0.1.0-alpha.3.1" />
                    
Directory.Packages.props
<PackageReference Include="EnvelopeFlow.Throttling" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EnvelopeFlow.Throttling --version 0.1.0-alpha.3.1
                    
#r "nuget: EnvelopeFlow.Throttling, 0.1.0-alpha.3.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EnvelopeFlow.Throttling@0.1.0-alpha.3.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EnvelopeFlow.Throttling&version=0.1.0-alpha.3.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=EnvelopeFlow.Throttling&version=0.1.0-alpha.3.1&prerelease
                    
Install as a Cake Tool

EnvelopeFlow.Throttling

The six-argument admission overload accepts an optional IMemorySubmissionConstraint. Its lease is acquired before delivery/policy locks and held through final begin commit. This supports optional destination availability without turning a sequential preflight into a spending guarantee. Existing constructor signatures and unselected behavior remain available. Constraints must be bounded, side-effect free except local locking, and release reliably on cancellation/failure.

Optional shared provider-account cost, concurrent-submission and cooldown budgets. ProviderBudgetKey identifies a trusted owner scope, provider and opaque account ID. The owner scope is always a member; additional complete scopes share a budget only through an explicitly authorized configuration. Applications own endpoint authorization, credential/account mapping and configuration revisions. Account IDs are identifiers, never credentials.

IProviderBudgetStore exposes owner-authorized CAS configuration, bounded inspection, explicit fenced unresolved-request reconciliation and cleanup. Limits use fixed UTC windows anchored to UTC ticks; a start consumes its configured cost once. Backward time does not reset a future window. Configuration changes preserve consumed cost/cooldown; window changes with live cost and any changes with unresolved starts refuse explicitly. Limits include total concurrent starts, reserved transactional slots, bounded transactional streaks and bounded permits/waiters. Active or Unknown submissions never expire merely because a lease ended. Cleanup removes at most 1–1000 completed permits older than 30 days; active/unresolved requests remain inspectable.

An accepted period change reanchors the empty or elapsed old window to the new period's UTC boundary and retires only its elapsed cost. Same-period edits retain current usage, and all edits retain cooldown and permit/waiter records. A period change while trusted time precedes the stored window start refuses conservatively; it cannot relabel a future window or refund its accounting.

The selected DeliveryDispatcher.WithSubmissionAdmission path uses one final ISubmissionAdmission, after side-effect-free live preflights. InMemoryProviderSubmissionAdmission joins the supplied memory delivery/routing and optional memory recipient-policy stores under their exclusive gates. A provider denial, policy denial, stale fence or expired claim spends neither a provider attempt nor recipient frequency. No provisional permit is exposed: rate/concurrency and final policy reservation commit with delivery begin in one operation. Do not add an independently reserving guard to this path. Custom integrations must implement the same atomic contract; unsupported compositions fail during construction.

Memory admission samples the budget's trusted UTC clock after acquiring every participating owner, including a contended recipient-policy lock. Provider windows, quiet hours, claim leases, delivery expiry and any owner-stamped SubmissionNotAfterUtc bound are checked before a debit publishes. Routed claims stamp and fence their immutable age deadline; a failed age-bound begin may then cancel/audit the route without a permit or frequency charge. Participating process-local stores must use coherent UTC clocks. Clock changes after a committed begin cannot retract provider work or erase its observed result.

Selected fair claims reserve max(1, batchSize/4) bulk slots and the remainder transactional slots, so batches must contain at least two slots. Unused shares are left unused; ordinary legacy claims retain their original behavior. Provider capacity separately reserves configured transactional slots. A waiting bulk request caps the transactional start streak only when its returned RetryAt is reached; its fairness vote expires five seconds after that eligibility floor or at original expiry, whichever is earlier. Active provider-denied work renews the vote. Policy refusal or a failed begin removes it immediately; external cancellation can retain at most a five-second turn when its floor is reached. Fairness requires active polling within that eligibility grace; paused hosts do not retain capacity indefinitely. Saturation defers through the existing fenced delivery capability, preserving expiry and deferral-count/horizon limits. It creates no provider attempt or frequency reservation; resumed work reruns live checks.

The opaque admission receipt binds the exact full scope, delivery/attempt, target hash, claim fence, configuration revision and application authority version. Completed Accepted/Rejected HTTP requests release concurrency; their cost is retained. Unknown and interrupted/crashed starts retain concurrent slots until explicit operator reconciliation. Reconciliation requires current fence and a fixed reason; it neither refunds cost nor replays delivery. Operators must establish request completion and honor any provider cooldown before reconciling. Observed Retry-After floors extend monotonically and duplicate completion cannot move the floor again. Provider results are persisted even if budget-result recording fails. The PostgreSQL adapter tracks live session owners and quarantines the account when an unacknowledged start loses its owner, so spare slots cannot bypass a lost cooldown write; retry the original result recording or explicitly reconcile before proceeding.

InMemoryProviderBudgetStore is bounded, process-local development storage. Restart loses all budgets/permits. Use the optional PostgreSQL adapter for independent workers/restart. Private mappings, target hashes and operational identities require application access/retention protection; no credential, address, message body or raw provider detail is logged. The provided APIs do not configure credentials, host routes or perform automatic fallback/replay.

For a selected immediate application send, admit a stable-key DeliveryRequest and invoke the configured dispatcher directly instead of a hosted loop; the same final admission controls that send. Queued retries, routed successors and explicitly authorized replays use the same dispatcher/store. Raw IEmailTransport, IPushTransport, ISmsTransport or unselected dispatcher calls bypass these budgets and remain the application's responsibility.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on EnvelopeFlow.Throttling:

Package Downloads
EnvelopeFlow.Throttling.Stores.Postgres

Optional PostgreSQL provider budgets and atomic provider/policy/delivery submission admission.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-alpha.3.1 49 11/22/2026
0.1.0-alpha.2.1 64 11/9/2026