[Code] async version of python-openid

Kevin Turner keturn at keturn.net
Sun Mar 20 22:49:38 UTC 2011


On Wed, 2011-03-16 at 23:44 +0300, Iakov Davydov wrote:
> Hello,
> I am now considering development of the python-openid consumer async
> version (mainly for use with tornado web server).

A few of us have looked in to this over the years (although more for
Twisted than Tornado).  The catch is that there are enough asynchronous
operations in the relying party (consumer) that I couldn't find any way
to compose the code to say "okay, all the OpenID algorithms and logic
are going in a library over here, that the asynchronous bits can call in
to from over there."  I think you have to write the whole API in
asynchronous style.

That's certainly doable, and if you were compelled to you could probably
even write it in such a way that synchronous users of the library could
use blocking implementations of HTTP and data store and be equally
happy, but --

the catch is that anyone maintaining or contributing to the library has
to keep the asynchronous API in mind, it's not the sort of thing where
the maintainer can just accept a patch that adds a flag and move on.

I think your options are to 

1) fork the library (or, uh, take over maintenance, since as far as I
can tell nobody's maintaining it right now).

2) spawn a thread to do the OpenID call.  (In Twisted, this would be
something like deferToThread(consumer.begin, openid_url)).


Sorry I don't have a more encouraging answer for you.

Good luck,

 - Kevin




More information about the Code mailing list