@spin_first<EOL><INDENT>def resubmit(self, indices_or_msg_ids=None, subheader=None, block=None):<DEDENT>
block = self.block if block is None else block<EOL>if indices_or_msg_ids is None:<EOL><INDENT>indices_or_msg_ids = -<NUM_LIT:1><EOL><DEDENT>if not isinstance(indices_or_msg_ids, (list,tuple)):<EOL><INDENT>indices_or_msg_ids = [indices_or_msg_ids]<EOL><DEDENT>theids = []<EOL>for id in indices_or_msg_ids:<EOL><INDENT>if isinstance(id, int):<EOL><INDENT>id = self.history[id]<EOL><DEDENT>if not isinstance(id, str):<EOL><INDENT>raise TypeError("<STR_LIT>"%id)<EOL><DEDENT>theids.append(id)<EOL><DEDENT>content = dict(msg_ids = theids)<EOL>self.session.send(self._query_socket, '<STR_LIT>', content)<EOL>zmq.select([self._query_socket], [], [])<EOL>idents,msg = self.session.recv(self._query_socket, zmq.NOBLOCK)<EOL>if self.debug:<EOL><INDENT>pprint(msg)<EOL><DEDENT>content = msg['<STR_LIT:content>']<EOL>if content['<STR_LIT:status>'] != '<STR_LIT>':<EOL><INDENT>raise self._unwrap_exception(content)<EOL><DEDENT>mapping = content['<STR_LIT>']<EOL>new_ids = [ mapping[msg_id] for msg_id in theids ]<EOL>ar = AsyncHubResult(self, msg_ids=new_ids)<EOL>if block:<EOL><INDENT>ar.wait()<EOL><DEDENT>return ar<EOL>
Resubmit one or more tasks.

        in-flight tasks may not be resubmitted.

        Parameters
        ----------

        indices_or_msg_ids : integer history index, str msg_id, or list of either
            The indices or msg_ids of indices to be retrieved

        block : bool
            Whether to wait for the result to be done

        Returns
        -------

        AsyncHubResult
            A subclass of AsyncResult that retrieves results from the Hub