-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Run asyncio coroutines #127
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
Conversation
|
Thanks for the submission, this looks good. [If you're still around, I know it's been a while since you opened the PR,] can you tell us a bit more about how you're using this? I haven't used asyncio before, and want a better understanding of how this will likely be used. |
|
We're going to introduce this soon |
Hi David, thanks for taking a look. I have several classes that define async functions. These functions are normally awaited on in the standard execution of the program, but sometimes it's useful to use the CLI via Fire to execute these functions individually. As a workaround, I've been creating |
|
One thing I'm wondering is: is there ever a time that you'd want to operate on the result of |
|
fyi iscoroutinefunction fails when passed an lru_cache decorated function. |
|
Also inspect.findsource fails on something in the testFireAsyncio testcase with an IndexError which may end up being Python bug (but we'll adapt Fire to handle it) since the documentation says findsource should only raise OSErrors. Will have to dig into it later. |
|
Merged with e4cb72a. |
COPYBARA_INTEGRATE_REVIEW=google/python-fire#127 from robweiss:run_coroutines 56bea93ea0340bea962a111bbd20122c1ad4beff PiperOrigin-RevId: 347872801 Change-Id: I17407ac8c3cb7b29026bd7d78729747a3a9875cf
COPYBARA_INTEGRATE_REVIEW=google/python-fire#127 from robweiss:run_coroutines 56bea93ea0340bea962a111bbd20122c1ad4beff PiperOrigin-RevId: 347872801 Change-Id: I17407ac8c3cb7b29026bd7d78729747a3a9875cf
COPYBARA_INTEGRATE_REVIEW=google/python-fire#127 from robweiss:run_coroutines 56bea93ea0340bea962a111bbd20122c1ad4beff PiperOrigin-RevId: 347872801 Change-Id: I17407ac8c3cb7b29026bd7d78729747a3a9875cf
COPYBARA_INTEGRATE_REVIEW=google/python-fire#127 from robweiss:run_coroutines 56bea93ea0340bea962a111bbd20122c1ad4beff PiperOrigin-RevId: 347872801 Change-Id: I17407ac8c3cb7b29026bd7d78729747a3a9875cf
COPYBARA_INTEGRATE_REVIEW=google/python-fire#127 from robweiss:run_coroutines 56bea93ea0340bea962a111bbd20122c1ad4beff PiperOrigin-RevId: 347872801 Change-Id: I17407ac8c3cb7b29026bd7d78729747a3a9875cf
COPYBARA_INTEGRATE_REVIEW=google/python-fire#127 from robweiss:run_coroutines 56bea93ea0340bea962a111bbd20122c1ad4beff PiperOrigin-RevId: 347872801 Change-Id: I17407ac8c3cb7b29026bd7d78729747a3a9875cf
COPYBARA_INTEGRATE_REVIEW=google/python-fire#127 from robweiss:run_coroutines 56bea93ea0340bea962a111bbd20122c1ad4beff PiperOrigin-RevId: 347872801 Change-Id: I17407ac8c3cb7b29026bd7d78729747a3a9875cf
This determines whether a function is a coroutine runs it accordingly