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

Library doesn't allow async processes #24

Open
faizann opened this issue Nov 18, 2016 · 3 comments
Open

Library doesn't allow async processes #24

faizann opened this issue Nov 18, 2016 · 3 comments

Comments

@faizann
Copy link

faizann commented Nov 18, 2016

Hi

I have noticed that once run is called the library goes into a loop of reading/blocking on websocket. This means that you lose control on your process after calling run.
This makes building multiprocessing/multithreaded applications impossible.

I suggest a way to make the reading part non-blocking so that app can do other things like use queues for multiprocessing. I suspect this library will not work very well on high loads where ARI apps has to do DB queries or making other HTTP API calls that can take a few seconds to respond.

@Caesar305
Copy link

Hi @faizann can you kindly explain your concern? We are currently working on a very large python project and we are concerned with your findings. Is there a way we can reproduce this issue? We have done several stress tests with no impact that we have noticed.

@faizann
Copy link
Author

faizann commented Apr 13, 2018

It has been a while since I looked at this code. We decided not to use Python library and went with GO as a language for better async processing.
The issue is 2 fold
1-- Python itself is very bad with multi-threading. Hence forking and queues need to be used which make things more complicated. Unlike GO where you can have go funcs that are easy to create and can still share memory if needed.
2-- The ARI library runs the websocket code is for obvious reasons is single threaded and runs in the main loop. This makes it harder to handle bigger traffic.

All in all it is just python and the architecture of python that limits the most.

@ldo
Copy link

ldo commented Dec 15, 2022

So they didn’t use asyncio to support a non-blocking event loop.

As alternatives that take advantage of coroutines, there is asyncari, or my own Seaskirt.

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

3 participants