(self, min_runspaces)
Sets the minimum number of Runspaces that the pool maintains in
        anticipation of new requests.

        :param min_runspaces: The minimum number of runspaces in the pool
Sets the minimum number of Runspaces that the pool maintains in
        anticipation of new requests.
Sets the minimum number of Runspaces that the pool maintains in anticipation of new requests .
def min_runspaces(self, min_runspaces):
        """
        Sets the minimum number of Runspaces that the pool maintains in
        anticipation of new requests.

        :param min_runspaces: The minimum number of runspaces in the pool
        """
        log.info("Setting minimum runspaces for pool to %d" % min_runspaces)
        if self.state != RunspacePoolState.OPENED:
            self._min_runspaces = min_runspaces
            return
        elif min_runspaces == self._min_runspaces:
            return

        def response_handler(response):
            if not response:
                raise InvalidPSRPOperation("Failed to set minimum runspaces")
            return response

        ci = self._ci_counter
        self._ci_counter += 1
        self.ci_table[ci] = response_handler

        set_min_runspace = SetMinRunspaces(min_runspaces=min_runspaces, ci=ci)
        data = self._fragmenter.fragment(set_min_runspace, self.id)[0]
        self.shell.send('stdin', data)

        while not isinstance(self.ci_table[ci], bool):
            self._receive()
        self._min_runspaces = min_runspaces
        del self.ci_table[ci]
def min_runspaces ( self , min_runspaces ) : log . info ( "Setting minimum runspaces for pool to %d" % min_runspaces ) if self . state != RunspacePoolState . OPENED : self . _min_runspaces = min_runspaces return elif min_runspaces == self . _min_runspaces : return def response_handler ( response ) : if not response : raise InvalidPSRPOperation ( "Failed to set minimum runspaces" ) return response ci = self . _ci_counter self . _ci_counter += 1 self . ci_table [ ci ] = response_handler set_min_runspace = SetMinRunspaces ( min_runspaces = min_runspaces , ci = ci ) data = self . _fragmenter . fragment ( set_min_runspace , self . id ) [ 0 ] self . shell . send ( 'stdin' , data ) while not isinstance ( self . ci_table [ ci ] , bool ) : self . _receive ( ) self . _min_runspaces = min_runspaces del self . ci_table [ ci ]