Hi all,
After learning gevent from documentation and some simple examples, a question emerges in my mind, just as the subject how gevent knows which type of event a registered task is interested in. For example, following most simple code is used usually,
def add(x, y):
return x + y
greenlet = gevent.spawn(add, 1, 2)
Many other similar example code may be given here to do some disk IO task or network IO task. However, no argument to indicate event type here. From the source code, greenlet.start method just adds such methods to libev event loop as callback function. I'm a bit confuse about this. Could anybody give some explanation and guidance? Thanks!
Regards,
Chenxiong Qi