Function af_core::run_with[][src]

pub fn run_with<T, E, F>(
    func: impl FnOnce(CancelSignal) -> F + Send + 'static
) -> ! where
    T: Send + 'static,
    E: Display + Send + 'static,
    F: Future<Output = Result<T, E>> + Send + 'static, 

Starts a task from the given function, waits for it to stop, then exits the process.

If the task fails, this function logs the error and exits the process with a non-zero exit code.

The provided function is passed a task::CancelSignal that is triggered when the process receives a termination signal (SIGINT, SIGTERM, or SIGQUIT).