Exemple #1
0
def retry_with_task(a, b, task=None):
    assert task is not None
    if a + b < 0:
        raise RetryTask()
    return a + b
Exemple #2
0
 def task_a(n):
     state[0] = state[0] + n
     if state[0] < 2:
         raise RetryTask('asdf')
     return state[0]
Exemple #3
0
def explicit_retry(k):
    if k not in state:
        state[k] = 'fixed'
        raise RetryTask()
    return state[k]
Exemple #4
0
 def retry_once():
     if not retry_once._did_retry:
         retry_once._did_retry = True
         raise RetryTask()
     return "Done."