This works well, however, when an exception occurs in the sub task, the parent task does not receive the exception. This is a real pain, and breaks my normal thinking about exception handling. When using normal function calls, the exception should always bubble up the stack until it is handled. Fibra should provide the same behavior for sub tasks.
Well, now it does. Snippet below.
if x < 5:
raise ValueError("x must be < 5")
# launch a sub task
# wait for it to finish and collect the result.
x = yield sub_task(4)
# the sub task will raise an exception here...
# yet the exception will bubble up to the parent task,
# just like a regular function call.
x = yield sub_task(5)
print "Oops, an exception occured."
schedule = fibra.schedule()
schedule.debug = True
>>> Oops, an exception occured.
These features will arrive with Fibra 0.0.11, which is coming Real Soon Now.