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

Asynchronous processing #16

Closed
mrocklin opened this issue Jan 5, 2018 · 7 comments
Closed

Asynchronous processing #16

mrocklin opened this issue Jan 5, 2018 · 7 comments

Comments

@mrocklin
Copy link
Member

mrocklin commented Jan 5, 2018

I notice that the kubernetes API has an async= keyword. Do you happen to know if people use this library with Tornado?

Incidentally this library is new and pops up in web searches: https://github.com/kippandrew/client-python-tornado It's obviously very new though.

@mrocklin
Copy link
Member Author

mrocklin commented Jan 5, 2018

Or maybe swagger can give this to us magically?

@mrocklin
Copy link
Member Author

@yuvipanda if I reall correctly you mentioned that there was an asyncio kubernetes library that was decent. Would you mind pointing out which one you meant here? (doing a web search turns up a couple)

@mrocklin
Copy link
Member Author

Never mind, on further investigation I see that @yuvipanda has been committing to https://github.com/olitheolix/aiokubernetes

@yuvipanda
Copy link
Collaborator

@mrocklin kubernetes-client/python#323 has discussion and links to two libraries. The one you linked to, and https://github.com/tomplus/kubernetes_asyncio. It's unclear which one to throw weight behind :) I like the design of https://github.com/olitheolix/aiokubernetes better though.

the async= parameter in kubernetes API is pretty bad - it makes a new thread and returns it! I think it has been changed to making a new threadpool and returning a thread from it, but I wouldn't consider any of these good python practices.

@minrk also has thoughts on this.

@minrk
Copy link

minrk commented Oct 26, 2018

The ThreadPool approach in kubernetes >=4 is the same as the one we use in kubespawner/binderhub (return ThreadPoolExecutor.submit(blocking_func)), and it works great (we just run kubernetes calls in a background thread of our own instead of passing an async arg per call). The downsides of using Python threads are often overstated, but a native asyncio API is still nice. From the looks of the examples, I would pick kubernetes_asyncio, which seems to have the most "the same as before, but add await" API, rather than what appears to be a much more complex and verbose API in aiokubernetes.

@jacobtomlinson
Copy link
Member

Closed in #162

@mrocklin
Copy link
Member Author

mrocklin commented Oct 14, 2019 via email

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

No branches or pull requests

4 participants