[Python-Dev] Py3k and asyncore/asynchat

Giampaolo Rodola' gnewsg at gmail.com
Fri Feb 15 20:45:14 CET 2008


On 15 Feb, 03:24, "Josiah Carlson" <josiah.carl... at gmail.com> wrote:

> As I stated 2+ and 6+ months ago, the patches I submitted 9+ months
> ago work (I've been using them in my own projects without issue).  The
> only issue with the bugfix/rearrangement that I last heard about with
> regards to the 2.x stuff was that I removed a class that no one was
> using in the wild, which I believe Giampaolo added in a subsequent
> patch in the last couple months.

I provided the patch for the other issue (look at what is specified in
ac_out_buffer_size) but I didn't re-add fifo and simple_producer
classes.
What should be done here? Re-add or discard them?
However, I will send to you by e-mail the modified asynchat version.
It is based on your patch therefore a first commit could be finally
done.

> My suggestion:
> 1. Apply the most recent fixes to 2.6 asyncore/asynchat that Giampaolo
> has updated.
> 1.a. Figure out what the hell is up with OOB data, how to handle it,
> and stop making it use handle_expt().

If we want to leave OOB untouched shouldn't handle_expt be the right
place where manage such kind of events?
Alternatively we could also remove the OOB management at all (e.g.
Twisted does that by ignoring such kind of data).
OOB could be actually useful to implement some protocols such as FTP
(in details ABOR and STAT commands which require OOB data) but it
would be probably better not having it than having it but not
implemented properly.
I am saying this also because later or soonish we might need to care
of epoll and kqueue (http://bugs.python.org/issue1657).

> * Scheduled tasks are not a valid enhancement for either; anyone who
> wants them can trivially add them with their own asyncore.loop()
> variant and call asyncore.poll() as necessary (I did it in about 15
> lines in the summer of 2002, I hope others can do better now).  If you
> want my opinion on other async-related features, feel free to email me
> directly (use the gmail address you see here, then it ends up in my
> inbox, not the overflowing python folder).

How's your solution? Could you post it here or send it to me by mail?
IMO scheduled tasks is a very important feature for implementing a lot
of interesting stuff like connection timeouts and bandwidth
throttling.
A lot of people have to learn/use Twisted just because of that.
Moreover I think that Bill Janssen could need that feature to make the
ssl module work with asyncore.


PS - I have been reading this mailing list for a short time therefore
I have no clue whether or not someone has ever thought about including
the Twisted core - only itself - in Python stdlib.


More information about the Python-Dev mailing list