diff options
Diffstat (limited to 'net/server_epoll.lua')
-rw-r--r-- | net/server_epoll.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua index 5ad20371..f767db78 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -74,6 +74,9 @@ local default_config = { __index = { -- Whether to kill connections in case of callback errors. fatal_errors = false; + -- Or disable protection (like server_select) for potential performance gains + protect_listeners = true; + -- Attempt writes instantly opportunistic_writes = false; }}; @@ -192,6 +195,9 @@ function interface:on(what, ...) self:noise("Missing listener 'on%s'", what); -- uncomment for development and debugging return; end + if not cfg.protect_listeners then + return listener(self, ...); + end local onerror = self.listeners.onerror or traceback; local ok, err = xpcall(listener, onerror, self, ...); if not ok then |