Closed j-hui closed 5 months ago
Can you elaborate on the motivation for using an async event loop? Are there any tradeoffs?
I added an "async" feature and published 0.55.0: https://crates.io/crates/piston/0.55.0
You call async_next
instead of next
.
We will try it out for a while and collect feedback.
I added an "async_test" example to the OpenGL graphics backend: https://github.com/PistonDevelopers/opengl_graphics/pull/340
There seems to be no problems supporting async. However, it will remain behind a feature flag "async" since most users don't need it.
Closing.
I'm hoping to integrate the piston event loop with some other async code. Is this a feature you would consider supporting?
As a proof-of-concept, I implemented this, with only two lines of change to the
next()
function; one to replace the use ofspin_sleep
withtokio::time::sleep
, and one to declare thenext()
functionasync
.I have two questions about this: