Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support async tasks? #924

Closed
naivefun opened this issue Dec 1, 2018 · 10 comments
Closed

support async tasks? #924

naivefun opened this issue Dec 1, 2018 · 10 comments

Comments

@naivefun
Copy link

naivefun commented Dec 1, 2018

now the http client is synchronised and we would like to use AioHttpClient to simulate large number of requests concurrently. However the task set supports no async def xxx() yet, adding support for async would be really helpful?

@ddorian
Copy link

ddorian commented Jan 21, 2019

@naivefun gevent ?

@aldenpeterson-wf
Copy link
Contributor

Why do you want to do this?

The easiest way is to create more locusts. The paradigm locust has is that each Locust is only executing one task simultaneously (reflecting user behavior). Does creating more clients not solve this situation?

@jjacobson93
Copy link

There are some libraries that are based around async. For example, I have use case for connecting to a websocket during a task. The popular websockets library uses asyncio: https://websockets.readthedocs.io/en/stable/intro.html

@naivefun
Copy link
Author

@aldenpeterson-wf I'm not familiar with python, but async enables NIO so that it scales up easily. Does this work the same way in python?

@Snyssfx
Copy link

Snyssfx commented Aug 30, 2019

I have to call asyncio websockets code from locustfile, seems it's not possible now.

@aldenpeterson-wf
Copy link
Contributor

I should say I have thought that it might be worthwhile to swap from gevent library to asyncio... or at least make that an option behind the scenes

@krzysiekb
Copy link

Yes, it would be worthwhile 👍

@pawamoy
Copy link

pawamoy commented Jan 31, 2020

Then I'll open a new issue to explicitly ask for asyncio support / rewrite.

@heyman
Copy link
Member

heyman commented Jan 31, 2020

See my comment here as it also applies to this issue as well: #1251 (comment)

@sergeyglazyrindev
Copy link

I have to call asyncio websockets code from locustfile, seems it's not possible now.

hey, have you considered the usage of the asgiref library in the locust sync functions ?

Guys, maintainers, theoretically, do you see any potential issues with using asgiref project to execute async functions as sync ones ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants