Skip to main content

serve_until

Function serve_until 

Source
pub async fn serve_until(opts: Opts, stop: Stop) -> Result<()>
Expand description

serve, but stopping when stop is set as well as on Ctrl-C.

A stop retires dispatch promptly, including while a worker launch is being acknowledged. Already reserved workers own their attempts independently and finish with their started executable. Explicit park additionally forwards durable park requests; neither scheduler retirement nor update does so.

While the queue is empty the stop is honoured within one wakeup rather than one poll interval: the wait is a select! against Stop’s notify, so a caller that taps stop does not sit through the remainder of a sleep.