pub async fn acquire(&self) -> Result<Acquired> {
        let (helper, tx) = match (self.helper.as_ref(), self.tx.as_ref()) {
            (Some(a), Some(b)) => (a, b),
            _ => return Ok(Acquired { _token: None }),
        };
        let (mytx, myrx) = oneshot::channel();
        helper.request_token();
        tx.unbounded_send(mytx).unwrap();

        let acquired = myrx
            .await
            .context("jobserver helper panicked")?
            .context("failed to acquire jobserver token")?;

        Ok(Acquired {
            _token: Some(acquired),
        })
    }
/// Returns a future that represents an acquired jobserver token.
///
/// This should be invoked before any "work" is spawned (for whatever the
/// definition of "work" is) to ensure that the system is properly
/// rate-limiting itself.
Returns a future that represents an acquired jobserver token.
This should be invoked before any "work" is spawned (for whatever the
definition of "work" is) to ensure that the system is properly
rate-limiting itself.
Returns a future that represents an acquired jobserver token . This should be invoked before any " work " is spawned ( for whatever the definition of " work " is ) to ensure that the system is properly rate - limiting itself .
pub async fn acquire(&self) -> Result<Acquired> {
        let (helper, tx) = match (self.helper.as_ref(), self.tx.as_ref()) {
            (Some(a), Some(b)) => (a, b),
            _ => return Ok(Acquired { _token: None }),
        };
        let (mytx, myrx) = oneshot::channel();
        helper.request_token();
        tx.unbounded_send(mytx).unwrap();
        let acquired = myrx
            .await
            .context("jobserver helper panicked")?
            .context("failed to acquire jobserver token")?;
        Ok(Acquired {
            _token: Some(acquired),
        })
    }
pub async fn acquire ( & self ) -> Result < Acquired > { let ( helper , tx ) = match ( self . helper . as_ref ( ) , self . tx . as_ref ( ) ) { ( Some ( a ) , Some ( b ) ) => ( a , b ) , _ => return Ok ( Acquired { _token : None } ) , } ; let ( mytx , myrx ) = oneshot :: channel ( ) ; helper . request_token ( ) ; tx . unbounded_send ( mytx ) . unwrap ( ) ; let acquired = myrx . await . context ( " " ) ? . context ( " " ) ? ; Ok ( Acquired { _token : Some ( acquired ) , } ) }
Returns a future that represents an acquired jobserver token.
Returns a future that represents an acquired jobserver token .
&self
&self