Skip to main content

bind_singleton_with

Function bind_singleton_with 

Source
pub fn bind_singleton_with<T, F>(
    socket_path: &str,
    bind: F,
) -> Result<T, BindSingletonError>
where F: FnMut() -> Result<T>,
Expand description

Bind a caller-owned listener with the same singleton and serialized stale recovery contract as bind_singleton.

This is for consumers that need listener options the default synchronous Listener does not expose (for example an async listener or a custom accept backlog). bind must attempt to claim socket_path without unlinking or reclaiming it first. It may be called up to three times: the ordinary bind, a serialized recheck after another contender may have recovered the path, and one final bind after this contender retires a still-stale endpoint.