-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the behavior consistent for asyncio and asynq: raised error. #136
Conversation
asynq does not cancel other concurrent tasks. import asyncio
from asynq import asynq
counter = 0
@asynq()
def f():
global counter
counter += 1
if counter == 3:
raise RuntimeError('error 3')
@asynq()
def g():
print('<<')
try:
yield [f.asynq(), f.asynq(), f.asynq(), f.asynq(), f.asynq()]
except Exception as e:
print('except', e)
print('>>')
g()
print('counter=',counter)
|
Can you fix this with |
Wait, no. We want |
Oh, I naively thought asynq will cancel the remaining tasks. Thanks for checking this.
It seems second one is more close to existing asynq. |
Changed to:
|
This PR addressed two behaviors: