net.server_epoll: Signal API-compatibilty with util.timer
authorKim Alvefur <zash@zash.se>
Mon, 29 Jun 2020 17:13:05 +0200
changeset 10987 0862325842ec
parent 10986 276f16101d59
child 10988 69ed4764edda
net.server_epoll: Signal API-compatibilty with util.timer Reduces the overhead of having both util.timer and the timer handling here, since they are very similar and now API-compatible.
net/server_epoll.lua
--- a/net/server_epoll.lua	Mon Jun 29 16:42:16 2020 +0200
+++ b/net/server_epoll.lua	Mon Jun 29 17:13:05 2020 +0200
@@ -896,6 +896,12 @@
 	addserver = addserver;
 	addclient = addclient;
 	add_task = addtimer;
+	timer = {
+		-- API-compatible with util.timer
+		add_task = addtimer;
+		stop = closetimer;
+		reschedule = reschedule;
+	};
 	listen = listen;
 	loop = loop;
 	closeall = closeall;