add unconstrained feature to service worker

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2025-02-06 23:58:45 +00:00 committed by strawberry
parent 5428526120
commit 59c073d0d8
3 changed files with 23 additions and 4 deletions

View file

@ -39,6 +39,11 @@ pub(crate) trait Service: Any + Send + Sync {
/// Return the name of the service.
/// i.e. `crate::service::make_name(std::module_path!())`
fn name(&self) -> &str;
/// Return true if the service worker opts out of the tokio cooperative
/// budgeting. This can reduce tail latency at the risk of event loop
/// starvation.
fn unconstrained(&self) -> bool { false }
}
/// Args are passed to `Service::build` when a service is constructed. This