From: Ben Darnell Date: Sun, 14 Nov 2010 20:58:14 +0000 (-0800) Subject: Improve docs for IOLoop.add/remove_timeout() X-Git-Tag: v1.2.0~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a941c42b27726aee81479be5f80b5a0d33631aa;p=thirdparty%2Ftornado.git Improve docs for IOLoop.add/remove_timeout() --- diff --git a/tornado/ioloop.py b/tornado/ioloop.py index ea34e0fe6..666257c99 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -309,12 +309,19 @@ class IOLoop(object): return self._running def add_timeout(self, deadline, callback): - """Calls the given callback at the time deadline from the I/O loop.""" + """Calls the given callback at the time deadline from the I/O loop. + + Returns a handle that may be passed to remove_timeout to cancel. + """ timeout = _Timeout(deadline, stack_context.wrap(callback)) bisect.insort(self._timeouts, timeout) return timeout def remove_timeout(self, timeout): + """Cancels a pending timeout. + + The argument is a handle as returned by add_timeout. + """ self._timeouts.remove(timeout) def add_callback(self, callback):