diff options
author | Erik Johnston <erik@matrix.org> | 2019-10-10 13:10:57 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2019-10-10 13:10:57 +0100 |
commit | 91f43dca3939cd6ccbc90d19a284d00f6e14fd7c (patch) | |
tree | cb15ddf14a01a0e67b9eaf91b482d65bf2057f4e /synapse/util/async_helpers.py | |
parent | Newsfile (diff) | |
parent | Add domain validation when creating room with list of invitees (#6121) (diff) | |
download | synapse-91f43dca3939cd6ccbc90d19a284d00f6e14fd7c.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/disable_sql_bytes
Diffstat (limited to 'synapse/util/async_helpers.py')
-rw-r--r-- | synapse/util/async_helpers.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/synapse/util/async_helpers.py b/synapse/util/async_helpers.py index f1c46836b1..0d3bdd88ce 100644 --- a/synapse/util/async_helpers.py +++ b/synapse/util/async_helpers.py @@ -13,9 +13,11 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + import collections import logging from contextlib import contextmanager +from typing import Dict, Sequence, Set, Union from six.moves import range @@ -213,7 +215,9 @@ class Linearizer(object): # the first element is the number of things executing, and # the second element is an OrderedDict, where the keys are deferreds for the # things blocked from executing. - self.key_to_defer = {} + self.key_to_defer = ( + {} + ) # type: Dict[str, Sequence[Union[int, Dict[defer.Deferred, int]]]] def queue(self, key): # we avoid doing defer.inlineCallbacks here, so that cancellation works correctly. @@ -340,10 +344,10 @@ class ReadWriteLock(object): def __init__(self): # Latest readers queued - self.key_to_current_readers = {} + self.key_to_current_readers = {} # type: Dict[str, Set[defer.Deferred]] # Latest writer queued - self.key_to_current_writer = {} + self.key_to_current_writer = {} # type: Dict[str, defer.Deferred] @defer.inlineCallbacks def read(self, key): |