diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2023-11-06 15:41:57 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-06 15:41:57 -0500 |
commit | 7e5d3b06fa8b6ce3676eb1178d7db0e252d48679 (patch) | |
tree | 868dd9c257a232886080e1a65a7588daa45c29aa /synapse/util | |
parent | Bump setuptools_rust to match pinned version. (#16605) (diff) | |
download | synapse-7e5d3b06fa8b6ce3676eb1178d7db0e252d48679.tar.xz |
Collect information for PushRuleEvaluator in parallel. (#16590)
Fetch information needed for push rule evaluation in parallel. Ideally this would use query pipelining, but this is not available in psycopg2. Due to the database thread pool this may result in little to no parallelization.
Diffstat (limited to 'synapse/util')
-rw-r--r-- | synapse/util/async_helpers.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/util/async_helpers.py b/synapse/util/async_helpers.py index 0cbeb0c365..8a55e4e41d 100644 --- a/synapse/util/async_helpers.py +++ b/synapse/util/async_helpers.py @@ -345,6 +345,7 @@ async def yieldable_gather_results_delaying_cancellation( T1 = TypeVar("T1") T2 = TypeVar("T2") T3 = TypeVar("T3") +T4 = TypeVar("T4") @overload @@ -380,6 +381,19 @@ def gather_results( ... +@overload +def gather_results( + deferredList: Tuple[ + "defer.Deferred[T1]", + "defer.Deferred[T2]", + "defer.Deferred[T3]", + "defer.Deferred[T4]", + ], + consumeErrors: bool = ..., +) -> "defer.Deferred[Tuple[T1, T2, T3, T4]]": + ... + + def gather_results( # type: ignore[misc] deferredList: Tuple["defer.Deferred[T1]", ...], consumeErrors: bool = False, |