Skip to main content

acquire_cli_slot

Function acquire_cli_slot 

Source
pub fn acquire_cli_slot(
    max_concurrency: usize,
    wait_seconds: Option<u64>,
) -> Result<(File, usize), AppError>
Expand description

AppError::AllSlotsFull { max, waited_secs: n } if no slot opens.

The returned File MUST be kept alive until the process exits; dropping it releases the slot automatically via the implicit flock on close.