
from time import time
from pyppl import PyPPL, Proc

pRetry         = Proc(desc = 'Retry when error happens.')
pRetry.input   = {"in": [0, 1]}
pRetry.errhow  = 'retry'
pRetry.forks   = 2
pRetry.errntry = 3
pRetry.args.t0 = time()
pRetry.lang    = "python"
pRetry.script  = """
from time import time, sleep
sleep(.4)
t = time() - {{args.t0}}
from sys import stderr
stderr.write('pyppl.log.debug: %s\\n' % t)
if t < 3:
  raise RuntimeError('Runtime error!')
"""

PyPPL().start(pRetry).run()

@@ -198,17 +198,18 @@
 rntry = 
-3
+10
 %0ApRetry.
@@ -312,9 +312,9 @@
 ep(.
-4
+2
 )%0At 
@@ -413,9 +413,9 @@
 t %3C 
-3
+2
 :%0A  

Make sure retry tutorial runs properly