Asyncio support
See original GitHub issueIs your feature request related to a problem? Please describe.
Sometimes one needs to simulate an asynchronous user behavior. Hatching more users does not solve the problem.
Describe the solution you’d like
Support defining async
tasks or something similar.
Describe alternatives you’ve considered
One could also write a custom client. Maybe this would solve the problem. It would be great to collect examples or snippets on how to do so in this issue, and add them in https://docs.locust.io/en/stable/testing-other-systems.html or another doc page.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
asyncio — Asynchronous I/O — Python 3.11.1 documentation
Hello World!: asyncio is a library to write concurrent code using the async/await syntax. asyncio is used as a foundation for multiple Python...
Read more >Async IO in Python: A Complete Walkthrough
Async IO is a concurrent programming design that has received dedicated support in Python, evolving rapidly from Python 3.4 through 3.7, and probably...
Read more >Asyncio support — python-can 4.0.0 documentation
This library supports receiving messages asynchronously in an event loop using the can.Notifier class. There will still be one thread per CAN bus...
Read more >Python Asyncio: The Complete Guide
It is proposed to make coroutines a proper standalone concept in Python, and introduce new supporting syntax. The ultimate goal is to help ......
Read more >Asynchronous I/O (asyncio) - SQLAlchemy 1.4 Documentation
Support for Python asyncio. Support for Core and ORM usage is included, using asyncio-compatible dialects. New in version 1.4. Warning.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can achieve this by spawning greenlets within your locust tasks. Here’s a small example:
Locust is heavily reliant on Gevent, and as far as I know gevent and python async are not 100% compatible. Therefore I don’t see locust supporting python
async
any time soon. There’s been discussion about it in the gevent project: https://github.com/gevent/gevent/issues/982@heyman sorry about confusion, looks like it was my mistake. Everything is ok with
requests.Session