Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

```python from gevent import monkey monkey.patch_all()

for url in list: gevent.spawn(lambda: requests.get(url)) ```

I concern this a problem already solved by gevent(or Erlang process / goroutine). Actually, I didn't see a benefit introduced by asyncio. Monkey patching seems scary but it works quite well in real projects. At least in my medium sized (50KLOC) game project.



   responses = await asyncio.gather(*(aiohttp.get(url) for url in urls))

Gevent isn't available everywhere, and it has compatibility issues. Monkey patching is also... horrible.


Don't use lambda.

    gevent.spawn(requests.get, url)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: