Closed kelvin-wong closed 3 years ago
close #2
gh-2
import asyncio import requests async def post_mail() -> None: post_mail_loop = asyncio.get_event_loop() futures = [ post_mail_loop.run_in_executor( None, requests.post, 'http://mail-test.localdev.com:4020/api/messages', { 'from': 'from@example.com', 'to': 'to@example.com', 'subject': 'subject', 'text': 'text', 'html': 'html', }, ) for _ in range(2**8) ] await asyncio.gather(*futures) loop = asyncio.get_event_loop() loop.run_until_complete(post_mail())
Attached a python script for reproducing the case
Thanks! I tested it and it looks like this solves the issue.
The test is good, it would be nice to have some unit tests in Go like that. I'll create an issue, though it's not too urgent.
close #2
gh-2
Attached a python script for reproducing the case