(self)
return avail_runspaces
Retrieves the number of runspaces available at the time of calling this
        method.

        :return: The number of available runspaces in the pool
Retrieves the number of runspaces available at the time of calling this
        method.
Retrieves the number of runspaces available at the time of calling this method .
def get_available_runspaces(self):
        """
        Retrieves the number of runspaces available at the time of calling this
        method.

        :return: The number of available runspaces in the pool
        """
        def response_handler(response):
            self._max_runspaces = response
            return response

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

        get_runspaces = GetAvailableRunspaces(ci=ci)
        data = self._fragmenter.fragment(get_runspaces, self.id)[0]
        self.shell.send('stdin', data)

        avail_runspaces = None
        while avail_runspaces is None:
            self._receive()
            if isinstance(self.ci_table[ci], int):
                avail_runspaces = self.ci_table[ci]

        del self.ci_table[ci]
        return avail_runspaces
def get_available_runspaces ( self ) : def response_handler ( response ) : self . _max_runspaces = response return response ci = self . _ci_counter self . _ci_counter += 1 self . ci_table [ ci ] = response_handler get_runspaces = GetAvailableRunspaces ( ci = ci ) data = self . _fragmenter . fragment ( get_runspaces , self . id ) [ 0 ] self . shell . send ( 'stdin' , data ) avail_runspaces = None while avail_runspaces is None : self . _receive ( ) if isinstance ( self . ci_table [ ci ] , int ) : avail_runspaces = self . ci_table [ ci ] del self . ci_table [ ci ] return avail_runspaces