summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorOlivier Wilkinson (reivilibre) <oliverw@matrix.org>2022-10-07 15:16:05 +0100
committerOlivier Wilkinson (reivilibre) <oliverw@matrix.org>2022-10-07 15:16:05 +0100
commit8de5c59fd3663fa55d0a6a939f35f6de0fc8bf01 (patch)
treec213e8b1c16334ba310d1b9e50f1625197303aca /synapse
parentBump msgpack from 1.0.3 to 1.0.4 (#14040) (diff)
downloadsynapse-8de5c59fd3663fa55d0a6a939f35f6de0fc8bf01.tar.xz
Use uvloop as an asyncio reactor event loop
Diffstat (limited to 'synapse')
-rw-r--r--synapse/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/__init__.py b/synapse/__init__.py
index 1bed6393bd..7bb07cfd05 100644
--- a/synapse/__init__.py
+++ b/synapse/__init__.py
@@ -44,6 +44,12 @@ if bool(os.environ.get("SYNAPSE_ASYNC_IO_REACTOR", False)):
 
         from twisted.internet import asyncioreactor
 
+        if bool(os.environ.get("SYNAPSE_UVLOOP", False)):
+            import uvloop
+
+            uvloop.install()
+            print("Using uvloop")
+
         asyncioreactor.install(asyncio.get_event_loop())
     except ImportError:
         pass