Re: improving async support in psycopg
Jan Urbański <[email protected]> Fri, 26 Mar 2010 04:20:20 +0100
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Message-ID | <[email protected]> |
On 24/03/10 22:32, Jan Urbański wrote: > I'll publish my psycopg2 branch after I clean it up a bit And here it is: http://git.wulczer.org/?p=psycopg2.git;a=summary I have implemented all (or so I think) the API I wrote about earlier, with one change: cursor.isready() got changed to cursor.poll(). This method just can't return a boolean, it has to somehow tell you which event should you wait for: socket writability or readability. I'm not terribly attached to the name, but since the API is changing, it might as well change the method name. Otherwise code that uses async might not notice that it's broken for a long time. If someone has a better proposal than poll(), or if the consensus is that isready() could return something that's not a boolean, I'm all ears. Documentation patches are missing from that repository, I'll wait with learning Sphinx until you guys give me some feedback on this ;) But of course if the feature would get accepted, I'll update the docs as well. I haven't done any Windows testing, but I'm almost 100% sure it's going to work. I also haven't tested against other PGs than 9.0devel, but then again the worst thing that can happen is that the unit tests will need some adjusting. Question: I don't really know what's the custom on this list: should I attach the patchset to a mail? Or is just pushing the changes to a git repo OK for you? My previous patches were done against the master branch of the git repo on initd.org, but I then noticed that the python2 branch is much more advanced... So I rebased against python2. Maybe there should be a notice somewhere that the active branch is python2, it took me some time to realize I'm working on old code :( Cheers, Jan _______________________________________________ Psycopg mailing list [email protected] http://lists.initd.org/mailman/listinfo/psycopg