diff options
author | Kim Alvefur <zash@zash.se> | 2020-06-30 18:31:48 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-06-30 18:31:48 +0200 |
commit | 7d8b2969cc5d61df047c7a6a1e9eb115cec40480 (patch) | |
tree | db17f786029a587c271a16e4c04d775a6d113275 /net/server_epoll.lua | |
parent | cca6ca589f9ac470e704e979b252839a3b121869 (diff) | |
download | prosody-7d8b2969cc5d61df047c7a6a1e9eb115cec40480.tar.gz prosody-7d8b2969cc5d61df047c7a6a1e9eb115cec40480.zip |
net.server_epoll: Add setting for turning off callback protections
Might improve (CPU) performance at the risk of triggering top level
errors.
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 |