5 ms·
>"Async" is optimized for I/O bound programs. Also works better than callbacks for single threaded/event loop scenarios like JS or some GUI framework (with the
by moonchrome 5y ago
>"Async" is optimized for I/O bound programs.
Also works better than callbacks for single threaded/event loop scenarios like JS or some GUI framework (with the caveat that you need to make sure you are resuming on the event loop if environment is multithreaded).
- mpweiher 5y agoHmm...isn't that event loop I/O and such programs I/O bound?
- moonchrome 5y agoNot necessarily, if you want to do non-blocking compute on client you would ideally spin off a worker thread but if not available you can periodically yield from your compute task to the event loop to avoid blocking.