mirror of https://github.com/Shizmob/pydle.git
Merge branch 'async' of github:Shizmob/pydle into async
This commit is contained in:
commit
0472d6020a
|
@ -13,8 +13,10 @@ class EventLoop:
|
||||||
'error': tornado.ioloop.IOLoop.ERROR
|
'error': tornado.ioloop.IOLoop.ERROR
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self, io_loop=None):
|
||||||
self.io_loop = tornado.ioloop.IOLoop.current()
|
if io_loop is None:
|
||||||
|
io_loop = tornado.ioloop.IOLoop.current()
|
||||||
|
self.io_loop = io_loop
|
||||||
self.running = False
|
self.running = False
|
||||||
self.handlers = {}
|
self.handlers = {}
|
||||||
self._context_future = None
|
self._context_future = None
|
||||||
|
@ -137,7 +139,7 @@ class EventLoop:
|
||||||
handle = self._do_schedule_in(interval, callback, args, kwargs)
|
handle = self._do_schedule_in(interval, callback, args, kwargs)
|
||||||
if callback(*args, **kwargs) == False:
|
if callback(*args, **kwargs) == False:
|
||||||
self.io_loop.remove_timeout(handle)
|
self.io_loop.remove_timeout(handle)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
Loading…
Reference in New Issue