add unconstrained feature to service worker
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
5428526120
commit
59c073d0d8
3 changed files with 23 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue