fn take_next_commits_if_needed(&mut self) -> Result<(), String> {
        // When updating this method, be sure to not hold lock longer than necessary,
        // since it can cause provers to not be able to interact with the server.

        // Clone the required data to process it without holding the lock.
        let (mut queue, limit) = {
            let pool = self.data.read().expect("failed to get read lock on data");
            (pool.op_queue.clone(), pool.limit)
        };

        // Process queue and fill it with data.
        queue.take_next_commits_if_needed(&self.conn_pool, limit)?;

        // Update the queues in pool.
        // Since this structure is the only writer to the queues, it is guaranteed
        // to not contain data that will be overwritten by the assignment.
        let mut pool = self.data.write().expect("failed to get write lock on data");
        pool.op_queue = queue;

        Ok(())
    }
/// Loads the operations to process for every available prover queue.
Loads the operations to process for every available prover queue.
Loads the operations to process for every available prover queue .
fn take_next_commits_if_needed(&mut self) -> Result<(), String> {
        // When updating this method, be sure to not hold lock longer than necessary,
        // since it can cause provers to not be able to interact with the server.
        // Clone the required data to process it without holding the lock.
        let (mut queue, limit) = {
            let pool = self.data.read().expect("failed to get read lock on data");
            (pool.op_queue.clone(), pool.limit)
        };
        // Process queue and fill it with data.
        queue.take_next_commits_if_needed(&self.conn_pool, limit)?;
        // Update the queues in pool.
        // Since this structure is the only writer to the queues, it is guaranteed
        // to not contain data that will be overwritten by the assignment.
        let mut pool = self.data.write().expect("failed to get write lock on data");
        pool.op_queue = queue;
        Ok(())
    }
fn take_next_commits_if_needed ( & mut self ) -> Result < ( ) , String > { // When updating this method, be sure to not hold lock longer than necessary, // since it can cause provers to not be able to interact with the server. // Clone the required data to process it without holding the lock. let ( mut queue , limit ) = { let pool = self . data . read ( ) . expect ( " " ) ; ( pool . op_queue . clone ( ) , pool . limit ) } ; // Process queue and fill it with data. queue . take_next_commits_if_needed ( & self . conn_pool , limit ) ? ; // Update the queues in pool. // Since this structure is the only writer to the queues, it is guaranteed // to not contain data that will be overwritten by the assignment. let mut pool = self . data . write ( ) . expect ( " " ) ; pool . op_queue = queue ; Ok ( ( ) ) }
Loads the operations to process for every available prover queue.
Loads the operations to process for every available prover queue .
&mut self