pub async fn wait_for_no_requests(self, interval_without_requests: Duration) {
        let mut last_call_subscriber = self
            .last_call_sender
            .get_or_init(|| watch::channel(Instant::now()).0)
            .subscribe();
        // Drop `last_call_sender` to handle the case when the server was dropped for other reasons.
        drop(self);

        let deadline = *last_call_subscriber.borrow() + interval_without_requests;
        let sleep = tokio::time::sleep_until(deadline.into());
        tokio::pin!(sleep);

        loop {
            tokio::select! {
                () = sleep.as_mut() => {
                    return; // Successfully waited for no requests
                }
                change_result = last_call_subscriber.changed() => {
                    if change_result.is_err() {
                        return; // All `ShutdownTimeout` instances are dropped; no point in waiting any longer
                    }
                    let new_deadline = *last_call_subscriber.borrow() + interval_without_requests;
                    sleep.as_mut().reset(new_deadline.into());
                }
            }
        }
    }
Waits until no new requests are received during the specified interval.
core/node/api_server/src/web3/backend_jsonrpsee/middleware.rs