You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, been thinking about this for a long while now. We have the necessary bits for asynchronous operations, and yes, it's on my to-do list to write an async HTTP client implementation. Modern ipython (and probably Jupyter notebook too) supports the await keyword.
This is untested of course, and we'd need to write some code to detect if we're on Python 3.5+ since this won't work on anything older. That has the potential though to make a much nicer experience for users, particularly interactive users.
On 25/11/20 2:48 am, Christian Tremblay wrote:
Pushing me down the canyon of async/await... :-)
Well… it's got to be a more natural solution than:
op = doSomething()
op.wait()
res = op.result
Next step then would be to implement an asynchronous HTTP client. I'd
be interested to see if `await` works in newer versions of Jupyter
Notebook. Support is in `ipython` v6 and later.
There's also support for Tornado, so Python 2.7 users who want async
action can `yield op.future` to do the same thing with Tornado v4.
Activity
Issue ChristianTremblay#103: util.state: Implement __await__ and .future
sjlongland commentedon Nov 24, 2020
Ohhh so much nicer!
Now, an asynchronous HTTP client and we're all set.
Issue ChristianTremblay#103: util.state: Re-structure for pre-3.3 Pyt…
ChristianTremblay commentedon Nov 24, 2020
Pushing me down the canyon of async/await... :-)
sjlongland commentedon Nov 24, 2020
ChristianTremblay commentedon Nov 25, 2020
Joking. It's awesome. Really.
But I haven't yet be able to wrap my head around async... I'll need some help ;-)
Issue ChristianTremblay#103: setup.py: Add optional dependencies.
Issue ChristianTremblay#103: util: Tweak test coverage
Issue ChristianTremblay#103: .travis.yml: Install optional dependencies
Issue ChristianTremblay#103: util.operation: Exclude abstract method …
Issue ChristianTremblay#103: util.operation: Add unit tests for base …
Issue ChristianTremblay#103: util.operation unit tests: Tweak documen…
Issue ChristianTremblay#103: util.awaitableop: Add unit tests
Issue ChristianTremblay#103: setup.py: Fix syntax error
Issue ChristianTremblay#103: util.operation: Use copy.copy() for shal…
Issue ChristianTremblay#103: util.operation: Add unit tests for base …
Issue ChristianTremblay#103: util.operation unit tests: Tweak documen…
Issue ChristianTremblay#103: util.awaitableop: Add unit tests
Issue ChristianTremblay#103: setup.py: Fix syntax error
Issue ChristianTremblay#103: util.awaitableop: Move to sub-package to…
ChristianTremblay commentedon Feb 26, 2021
I'll keep this open and tag myself as documentation would probably be a good way for me to learn.... If I can find some time.