(self, max_runspaces)
Sets the maximum number of Runspaces that can be active concurrently
        in the pool. All requests above that number remain queued until
        runspaces become available.

        :param max_runspaces: The maximum number of runspaces in the pool
Sets the maximum number of Runspaces that can be active concurrently
        in the pool. All requests above that number remain queued until
        runspaces become available.
Sets the maximum number of Runspaces that can be active concurrently in the pool . All requests above that number remain queued until runspaces become available .
def max_runspaces(self, max_runspaces):
        """
        Sets the maximum number of Runspaces that can be active concurrently
        in the pool. All requests above that number remain queued until
        runspaces become available.

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

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

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

        set_max_runspace = SetMaxRunspaces(max_runspaces=max_runspaces, ci=ci)
        data = self._fragmenter.fragment(set_max_runspace, self.id)[0]
        self.shell.send('stdin', data)

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