[Patches] [ python-Patches-648322 ] asyncore loop_once and remove poll2

SourceForge.net noreply at sourceforge.net
Wed Oct 22 10:28:49 EDT 2003

Patches item #648322, was opened at 2002-12-04 05:55
Message generated for change (Comment added) made by akuchling
You can respond by visiting: 

Category: Library (Lib)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Kjetil Jacobsen (kjetilja)
Assigned to: A.M. Kuchling (akuchling)
Summary: asyncore loop_once and remove poll2

Initial Comment:
this patch does two things to asyncore.py, none of them should break any existing code which uses the module:

1) remove the (broken) poll2 function, and rather make a reference from poll2 to poll3 in the module namespace (i.e. if someone actually uses the poll2 function, poll3 will be called instead).

2) add a function loop_once which performs the asyncore loop once instead of until the socket map is empty.  asyncore.loop_once has the same function signature as asyncore.loop.


>Comment By: A.M. Kuchling (akuchling)
Date: 2003-10-22 10:28

Logged In: YES 

poll2() is written for a "poll" extension module that came with the Medusa 
distribution, so it'll never be used with a Python installation and poll2() can be 
safely removed.  

I'm less enthusiastic about loop_once().  Existing code that needs to loop once 
has been simply calling asyncore.poll(), which works fine (though perhaps 
suboptimally -- but 99% of asyncore applications won't care).  


Comment By: Kjetil Jacobsen (kjetilja)
Date: 2002-12-05 13:46

Logged In: YES 

asyncore.poll2 is broken because it does not mask the EINTR exception when invoking the poll.poll function.  this causes asyncore.poll2 to not have the same semantics as asyncore.poll and asyncore.poll3.

i don't see the point in preserving support for the poll2 function, as the poll function is now automatically a part of the select module if the system has poll support.   or am i missing something obvious here? :)

if use_poll is set and there is no poll on the system, asyncore.loop and asyncore.loop_once will fail the same way they did before.  


Comment By: Martin v. Löwis (loewis)
Date: 2002-12-05 11:49

Logged In: YES 

Can you please explain in what way poll2 is broken?

Also, what happens if use_poll is set, but there is no poll 
available on the system?


You can respond by visiting: 

More information about the Patches mailing list