summary refs log tree commit diff
path: root/synapse/types.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-04-23 17:26:31 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-04-23 17:26:31 +0100
commit7fffd3789b0cf50917d6d4e01b48d3bdb255574b (patch)
treef41cf82c6b68d631792f7847fca7945e0d47e3a6 /synapse/types.py
parentMerge commit '15c788e22' into anoa/dinsic_release_1_31_0 (diff)
parentPrevent the config-lint script erroring out on any sample_config changes (#9562) (diff)
downloadsynapse-7fffd3789b0cf50917d6d4e01b48d3bdb255574b.tar.xz
Merge commit '22db45bd4' into anoa/dinsic_release_1_31_0
Diffstat (limited to 'synapse/types.py')
-rw-r--r--synapse/types.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/synapse/types.py b/synapse/types.py

index b629976853..6a41a3665d 100644 --- a/synapse/types.py +++ b/synapse/types.py
@@ -36,6 +36,14 @@ import attr from signedjson.key import decode_verify_key_bytes from six.moves import filter from unpaddedbase64 import decode_base64 +from zope.interface import Interface + +from twisted.internet.interfaces import ( + IReactorCore, + IReactorPluggableNameResolver, + IReactorTCP, + IReactorTime, +) from synapse.api.errors import Codes, SynapseError from synapse.util.stringutils import parse_and_validate_server_name @@ -68,6 +76,14 @@ MutableStateMap = MutableMapping[StateKey, T] JsonDict = Dict[str, Any] +# Note that this seems to require inheriting *directly* from Interface in order +# for mypy-zope to realize it is an interface. +class ISynapseReactor( + IReactorTCP, IReactorPluggableNameResolver, IReactorTime, IReactorCore, Interface +): + """The interfaces necessary for Synapse to function.""" + + class Requester( namedtuple( "Requester",