mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-11-30 22:25:35 +03:00
a1da85a24b
Previously whenever a future readiness notification came in we would immediately start polling a future. This ends up having two downsides, however: * First, the stack depth may run a risk of getting blown. There's no recursion limit to defer execution to later, which means that if futures are always ready we'll keep making the stack deeper. * Second, and more worrisome in the near term, apparently future adapaters in the `futures` crate (namely the unsync oneshot channel) doesn't actually work if you immediately poll on readiness. This may or may not be a bug in the `futures` crate but it's good to fix it here anyway. As a result whenever a future is ready to get polled again we defer its polling to the next turn of the event loop. This should ensure that the current call stack is always drained and we're effectively enqueueing the future to be polled in the near future. |
||
---|---|---|
.. | ||
tests.rs |