Commit 75917789 authored by Jason Madden's avatar Jason Madden

convert feed to a shared function. Now around 23776 LOC, more than 10K less than we started.

parent 82f34140
......@@ -680,15 +680,6 @@ cdef public class callback [object PyGeventCallbackObject, type PyGeventCallback
Py_DECREF(<PyObjectPtr>self) \
self._flags &= ~1 \
\
\
def feed(self, int revents, object callback, *args): \
_check_loop(self.loop) \
self.callback = callback \
self.args = args \
LIBEV_UNREF \
libev.ev_feed_event(self.loop._ptr, &self._watcher, revents) \
PYTHON_INCREF \
\
cdef void _do_libev_start(self): \
libev.ev_##TYPE##_start(self.loop._ptr, &self._watcher)
......@@ -776,6 +767,14 @@ cdef public class watcher [object PyGeventWatcherObject, type PyGeventWatcher_Ty
# This is not allowed to fail, and must be implemented by subclasses.
return
def feed(self, int revents, object callback, *args):
_check_loop(self.loop)
self.callback = callback
self.args = args
LIBEV_UNREF
libev.ev_feed_event(self.loop._ptr, self.__watcher, revents)
PYTHON_INCREF
def __repr__(self):
if Py_ReprEnter(<PyObjectPtr>self) != 0:
return "<...>"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment