7 ms·
Here is a comparison of `asyncio` (Python), `async` (Ruby) and Go: https://github.com/socketry/async-await/tree/master/examples/port_scanner https://github.com/
by ioquatix 8y ago
Here is a comparison of `asyncio` (Python), `async` (Ruby) and Go: https://github.com/socketry/async-await/tree/master/examples/port_scanner https://github.com/socketry/async-await/tree/master/examples...
I wrote a similar article but for Ruby: https://www.codeotaku.com/journal/2018-06/asynchronous-ruby/index https://www.codeotaku.com/journal/2018-06/asynchronous-ruby/...
Yes, it's a good model for many use cases.
One thing I wondered about Ruby, is it really necessary to have the `await` keyword?
- kasbah 8y ago`await` is useful since with the absence of it you can schedule multiple tasks concurrently. In JS: var task1 = someAsyncTask1() var task2 = someAsyncTask2() await Promise.all([task1, task2]) If `await` was implicit then task2 would wait for task1 to finish.