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 work #63

Closed
evilham opened this issue Jun 19, 2018 · 7 comments
Closed

Asynchronous work #63

evilham opened this issue Jun 19, 2018 · 7 comments

Comments

@evilham
Copy link

evilham commented Jun 19, 2018

This issue is basically to start the discussion around asynchronous usage of this library, see if there are ideas/issues/restrictions around that.

I am particularly interested in working with this library from Twisted, but asyncio is now officially part of python.
There is https://github.com/crossbario/txaio which aims to be a bridge between both async frameworks.

Thoughts? Is it worth the time investment? or should I just build (and open-source) twisted-specific wrappers around authlib?

This is particularly interesting for the server side of things.

@lepture
Copy link
Owner

lepture commented Jun 19, 2018

I myself think the implementation and the API of asyncio are terrible. It could be hard to support Python 2.7 in asyncio way. I'd like to add it later after Authlib turning to 1.0. Maybe async feature could be an Authlib 2.0 thing.

@xen
Copy link

xen commented Jun 20, 2018

Asyncio is evolving and in 3.8 will be much better. You will not need to sting all code around loop object. Only declare loop once. Also, 2.7 have the end of life date, which is very soon.

@traverseda
Copy link

Seconding that you shouldn't really be worrying about 2.7, the 2.* line of python is going to be EOL in 2020, so nobody should be building new software on 2.*.

You could write the code purely as an asynchronous library, then provide a synchronous API into it using loop.run_until_complete(), but that seems like a bit of a pain...

I'm not sure what the advantage of using asyncio would be for this, as none of the web-frameworks it integrates with are natively asynchronous. Instead, why not document how to run authlib in a thread, from an asynchronous app? More on that here.

@lepture
Copy link
Owner

lepture commented Sep 18, 2018

There is a plan to add async support in werkzeug which brings this issue to me. But I still think async should be added after v1.0. I should still focus on implementing the missing features.

@lepture
Copy link
Owner

lepture commented Oct 8, 2019

Our client part is async now in v0.13.

@lepture
Copy link
Owner

lepture commented Nov 11, 2019

We have async client now. Close this issue, we are not going to add async server until v2.0

@aliev
Copy link

aliev commented Dec 12, 2020

If you look for a purely async oauth2 implementation, there is aioauth: https://github.com/aliev/aioauth, and I'm working on it to resolve this issue. It is MIT-licensed, fully test-covered, and simple, and I'd love to get your feedback or involvement.

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

5 participants