This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Little (improvement and standarization) to asyncore.
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: josiahcarlson Nosy List: aweil, josiahcarlson, loewis, rhettinger
Priority: normal Keywords: patch

Created on 2004-03-11 12:55 by aweil, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
asyncore.py.diff1 aweil, 2004-03-11 12:55
Messages (5)
msg45488 - (view) Author: alejandro david weil (aweil) Date: 2004-03-11 12:55
changes: 
1- uses add/del_channel/setup_socket functions. 
Adding calls to them instead of pasting its functionallity 
inside dispatcher's code. 
 
2- added dispatcher's handle_connect_event() function. 
It's now, one place to overwrite when transparent 
wrapping dispatcher. 
 And replaced code like: 
        self.handle_connect() 
        self.connected = 1 
to: 
        handle_connect_event() 
 
3- looponce() function added. 
 
 
2 allowes to implement ssldispatcher, with little work. 
And, of course, it seems to be usefull for anyone who 
wants to subclass dispatcher. 
 
3 I used it for when I don't want to keep looping until 
connections are finished. Don't know if it's against the 
asyncore principies. 
 
Also, I decided to make this changes because I found 
things like: handle_connect() was called, and sometimes 
connected were setup to 1 before, and sometimes after 
the call. I'll expect these changes could make it work in 
a predecible way! 
msg45489 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2004-03-13 20:30
Logged In: YES 
user_id=80475

Andrew, is this module your baby now?
msg45490 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-03-06 14:48
As Andrew didn't respond positively, trying somebody else: Josiah, is it your?
msg45491 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2007-03-06 16:33
Yes, this would be my baby now.  A brief reading of the description of the patch suggests that portions were previously committed.  Will look at later today.
msg45492 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2007-03-07 08:46
Changes to the poll method were done at least a year and a half ago that *added* actual error checking, rather than removing the stub.

The looponce() function is unnecessary due to changes for 2.4 or 2.5 that added an optional "count" argument to loop().

There is some positive stuff in the create_socket/set_socket stuff, but I've integrated it with some other changes I'm going to be posting shortly.

A variant of the close() modifications were done a while ago.

The handle_connect_event is an idea, I had included equivalent semantics in other code I had written, but moving it to a method is better.

I'm going to reject the patch as out of date, as most of the issues were previously taken care of.  Those ideas that help, I have added them to an updated asyncore that I will be posting soon.
History
Date User Action Args
2022-04-11 14:56:03adminsetgithub: 40023
2004-03-11 12:55:47aweilcreate