Asyncio more generally
So, ipython and jupyter now include a magic event loop and you can do-
async def foo():
return 'Hi'
await foo()
And it'll just work. This raises the interesting possibility that we could move to a fully async flowclient and/or flowmachine. Both are pretty well suited - most blocking things block because they're waiting on the network. One issue when it comes to flowmachine is that sqlalchemy, which currently drives the database, is not (nor shall be anytime soon), async friendly.
This isn't any kind of immediate priority, just one to mull over really.
I was thinking about this in the context of flowmachine over the weekend.
One key thing that would need to happen to allow us to make db connections fully async is to remove any communication with the db from __init__. This is something we'd danced around for a while, because it would be a good idea in general but is a bit of a fiddle.
The main reason we talk to the db during object creation is to prevent the creation of queries that will fail when run. We would, I think, want to add a preflight method that checks viability. Would also need to excise any sqlalchemy business for creating subsets.
Relates to #173
SQLAlchemy is now async friendly, so this is less of a stretch now.