API for WEB: bounded lifecycle and overload observability added

Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
This commit is contained in:
Alexey
2026-08-29 16:19:21 +03:00
parent 012dc07a98
commit 084834f5ec
45 changed files with 2440 additions and 298 deletions
+10 -2
View File
@@ -46,7 +46,7 @@ pub(super) async fn reserve_data(
cancellation: &CancellationToken,
timeout: Duration,
) -> Result<WebSocketBudgetLease, ()> {
tokio::time::timeout(timeout, async {
match tokio::time::timeout(timeout, async {
loop {
if cancellation.is_cancelled() {
return Err(());
@@ -63,7 +63,15 @@ pub(super) async fn reserve_data(
}
})
.await
.map_err(|_| ())?
{
Ok(result) => result,
Err(_) => {
runtime.telemetry().record_rejection(
crate::web::telemetry::WebRejectionReason::WebSocketBytesCapacity,
);
Err(())
}
}
}
pub(super) async fn process_multiplex(