asyncore: where is handle_timeout() ?

Fredrik Lundh effbot at telia.com
Sat Oct 14 07:01:22 EDT 2000


u7361251 at N-o_S-p-a-m-cotse.com wrote:
> Is there a reason, why asyncore.Dispatcher does not offer a
> handle_timeout().  As far as I understand it would be as simple
> as adding something like:
>
> if not (e or r or w):
>     x.handle_timeout ()

hint: what's "x" is supposed to be here?

> Of course I could implement my own loop() and poll() function
> outside asyncore, but it does not "feel" right.

doesn't make sense either: all you need to do is to
implement your own loop replacement:

    while asyncore.socket_map:
        asyncore.poll(timeout)
        # do whatever you think you need to do
        # when there hasn't been any activity on
        # *any* socket for timeout seconds...

> If not, wouldn't it be a good chance to get it into 2.0?

the 2.0 code base is frozen.

</F>





More information about the Python-list mailing list