Skip to content
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

Return an explicit and useful object in apply_async() #32

Open
diox opened this issue May 3, 2023 · 0 comments
Open

Return an explicit and useful object in apply_async() #32

diox opened this issue May 3, 2023 · 0 comments

Comments

@diox
Copy link
Member

diox commented May 3, 2023

The return value of PostRequestTask.apply_async(), when task queuing is enabled, is None instead of an AsyncResult. It makes sense since the task has not been sent yet, but it's annoying when you want to do something with the AsyncResult...

So ideally, we should return some kind of object instead, like a PostRequestTaskAsyncResult, which would be a proxy for AsyncResult. In that proxy object, accessing any property should cause us to bypass the task queuing, triggering the original apply_async() method, sending the task to the broker instead of waiting for the request to finish. We could then grab the AsyncResult and return the value of the property being accessed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant