webloop should support cancellation
To-do: example of it not supporting cancellation here. Cc @CNSeniorious000
I am trying to abort ongoing fetches when micropip fails to resolve a dependency, so I want to cancel other running futures when one future ends up with an exception, so I wrote this:
for future in futures:
if not future.done():
future.cancel()
But I still got several asyncio.exceptions.InvalidStateError: invalid state exception in stderr. I think since I've ensure that future is not done, cancel it shouldn't raises any exception.
However, I am still investigating this, not sure whether this is a bug of pyodide.webloop because I seldom use .cancel() on futures before. Not experienced in this field.
I strongly believe that it's a bug in webloop.