Open ccorcos opened 10 years ago
I checked out your library and the implementation looks clean (34 LOC - nice work!). I don't have time at the moment to add parity functions for all the async methods. But I'm going to keep this open as a feature request.
One more thing, have you tested your package with python 3.x? (not saying that python-meteor
does but mostly thinking ahead)
I have yet to touch python 3, haha. I suppose I probably should at some point, but just about every library is written for 2 so I'm not sure when I'm going to transition...
Wouldn't this be better implemented using generators?
I've head about generators but I don't know how they are used for this kind of stuff. I'd be happy to hear your idea
After more thought I do not think it is possible to do it with just generators. But probably a better approach to the whole thing would be using greenlets, a coroutine approach, similar to node-fibers. And then there is geven-websocket. So we could get a blocking-looking interface similar to node-fibers, but have asynchronous behavior in the background.
Or just use Tornado, maybe :+1:
Hey, I just created a package
syncify
to wrap client method calls so they behave synchronously.That way you dont have to do the while True hack when scripting.