jnpr/space/async.py
def wait_for_task(self, task_id):
        """
        Waits for the given task to complete by periodically pulling
        progress-update messages from the hornet-q and checking if the message
        indicates that the task is Done. The time between consecutive pulls
        is the value given as the ``wait_time`` argument in the constructor.
        The maximum number of consecutive pulls is determined by the
        ``max_consecutive_attempts`` argument in the constructor. If we're
        unable to pull a progress-update message from hornet-q after this many
        consecutive attempts, we will consider the task as hanging and this
        method will raise an Exception.

        .. note::
            You should use this method only when you have created one task using
            this TaskMonitor object. If you created multiple tasks, you must
            use the wait_for_tasks() method to wait for their completion.

        :returns:  The final progress-update message for the task is fetched
            and returned inside a Python object. The ``data`` attribute of this
            object will contain the full result from the task.
        """

        num_consecutive_attempts = 0
        while num_consecutive_attempts < self.max_consecutive_attempts:
            message = self.pull_message()
            if message is None:
                num_consecutive_attempts += 1
                time.sleep(self.wait_time)
                continue
            else:
                num_consecutive_attempts = 0

            if task_id != message.taskId:
                continue

            if self._task_is_done(message):
                return self.get_final_progress_update(message)

        raise Exception("Task %s does not seem to be progressing" % task_id)

        Waits for the given task to complete by periodically pulling
        progress-update messages from the hornet-q and checking if the message
        indicates that the task is Done. The time between consecutive pulls
        is the value given as the ``wait_time`` argument in the constructor.
        The maximum number of consecutive pulls is determined by the
        ``max_consecutive_attempts`` argument in the constructor. If we're
        unable to pull a progress-update message from hornet-q after this many
        consecutive attempts, we will consider the task as hanging and this
        method will raise an Exception.

        .. note::
            You should use this method only when you have created one task using
            this TaskMonitor object. If you created multiple tasks, you must
            use the wait_for_tasks() method to wait for their completion.

        :returns:  The final progress-update message for the task is fetched
            and returned inside a Python object. The ``data`` attribute of this
            object will contain the full result from the task.
        
Waits for the given task to complete by periodically pulling
progress-update messages from the hornet-q and checking if the message
indicates that the task is Done. The time between consecutive pulls
is the value given as the ``wait_time`` argument in the constructor.
The maximum number of consecutive pulls is determined by the
``max_consecutive_attempts`` argument in the constructor. If we're
unable to pull a progress-update message from hornet-q after this many
consecutive attempts, we will consider the task as hanging and this
method will raise an Exception.

:
You should use this method only when you have created one task using
this TaskMonitor object. If you created multiple tasks, you must
use the wait_for_tasks() method to wait for their completion.
Waits for the given task to complete by periodically pulling progress - update messages from the hornet - q and checking if the message indicates that the task is Done . The time between consecutive pulls is the value given as the ` ` wait_time ` ` argument in the constructor . The maximum number of consecutive pulls is determined by the ` ` max_consecutive_attempts ` ` argument in the constructor . If we ' re unable to pull a progress - update message from hornet - q after this many consecutive attempts we will consider the task as hanging and this method will raise an Exception . : You should use this method only when you have created one task using this TaskMonitor object . If you created multiple tasks you must use the wait_for_tasks () method to wait for their completion .
def wait_for_task(self, task_id):
        num_consecutive_attempts = 0
        while num_consecutive_attempts < self.max_consecutive_attempts:
            message = self.pull_message()
            if message is None:
                num_consecutive_attempts += 1
                time.sleep(self.wait_time)
                continue
            else:
                num_consecutive_attempts = 0
            if task_id != message.taskId:
                continue
            if self._task_is_done(message):
                return self.get_final_progress_update(message)
        raise Exception("Task %s does not seem to be progressing" % task_id)
def wait_for_task ( self , task_id ) : num_consecutive_attempts = 0 while num_consecutive_attempts < self . max_consecutive_attempts : message = self . pull_message ( ) if message is None : num_consecutive_attempts += 1 time . sleep ( self . wait_time ) continue else : num_consecutive_attempts = 0 if task_id != message . taskId : continue if self . _task_is_done ( message ) : return self . get_final_progress_update ( message ) raise Exception ( "Task %s does not seem to be progressing" % task_id )
Waits for the given task to complete by periodically pulling
progress-update messages from the hornet-q and checking if the message
indicates that the task is Done.
Waits for the given task to complete by periodically pulling progress - update messages from the hornet - q and checking if the message indicates that the task is Done .
"""
        Waits for the given task to complete by periodically pulling
        progress-update messages from the hornet-q and checking if the message
        indicates that the task is Done. The time between consecutive pulls
        is the value given as the ``wait_time`` argument in the constructor.
        The maximum number of consecutive pulls is determined by the
        ``max_consecutive_attempts`` argument in the constructor. If we're
        unable to pull a progress-update message from hornet-q after this many
        consecutive attempts, we will consider the task as hanging and this
        method will raise an Exception.

        .. note::
            You should use this method only when you have created one task using
            this TaskMonitor object. If you created multiple tasks, you must
            use the wait_for_tasks() method to wait for their completion.

        :returns:  The final progress-update message for the task is fetched
            and returned inside a Python object. The ``data`` attribute of this
            object will contain the full result from the task.
        """
The final progress-update message for the task is fetched
and returned inside a Python object. The ``data`` attribute of this
object will contain the full result from the task.
The final progress - update message for the task is fetched and returned inside a Python object . The ` ` data ` ` attribute of this object will contain the full result from the task .
self
task_id