Hacker News new | ask | show | jobs
by ironhaven 954 days ago
block_on is a executor that polls a future until it returns ready. If the future is not ready then the executor wait until it is woken up. If you poll a future that relies on a specific runtime (I.g. A async library that uses Tokio) to wake up the executor, with a simple block_on you will get stuck.

A generic block_on in std would be a footgun for new programmers I believe.

1 comments

The proposals to add block_on generally include an executor like pollster.