From b4b19f1dce1805bef4e38d0778f03fb2653ab2a0 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 11 Dec 2015 22:53:29 +0200 Subject: [PATCH] uasyncio: Schedule simple I/O completion callbacks directly in event loop. Simple == without args. This is expected action for them, and saves creation of lambda just for that. Actually, probably all callbacks should be handled this way. --- uasyncio/uasyncio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uasyncio/uasyncio/__init__.py b/uasyncio/uasyncio/__init__.py index 6dd5cdf6..218cea4c 100644 --- a/uasyncio/uasyncio/__init__.py +++ b/uasyncio/uasyncio/__init__.py @@ -58,7 +58,7 @@ class EpollEventLoop(EventLoop): if isinstance(cb, tuple): cb[0](*cb[1]) else: - cb() + self.call_soon(cb) class StreamReader: