[Python-ideas] async: feedback on EventLoop API
Ronan Lamy
ronan.lamy at gmail.com
Mon Dec 17 21:33:23 CET 2012
Le 17/12/2012 17:47, Guido van Rossum a écrit :
> (BTW, can someone *please* come up with a better name for DelayedCall?
> It's tedious and doesn't abbreviate well. But I don't want to name the
> class 'Callback' since I already use 'callback' for function objects
> that are used as callbacks.)
It seems to me that a DelayedCall is nothing but a frozen, reified
function call. That it's a reified thing is already obvious from the
fact that it's an object, so how about naming it just "Call"? "Delayed"
is actually only one of the possible relations between the object and
the actual call - it could also represent a cancelled call, or a cached
one, or ...
This idea has some implications for the design: in particular, it means
that .cancel() should be a method of the EventLoop, not of Call. So Call
would only have the attributes 'callback' (I'd prefer 'func' or similar)
and 'args', and one method to execute the call.
HTH,
Ronan Lamy
More information about the Python-ideas
mailing list