pub fn run_and_stop_if_exists<S, F, T>(
subject: &S,
options: S::Options<'_>,
lock: UnlockedFile,
action: F,
) -> Result<T, CoordinateError<S::Error>>Expand description
Perform action in subject if it exists.
Using the given lock for synchronisation, this starts the subject it if itβs
not running, performs the action, then (maybe) stops the subject again,
and finally returns the result of action. If there are other users of the
subject β i.e. if an exclusive lock cannot be acquired during the shutdown
phase β then the subject is left running.