Convert the remaining media repo code to async / await. (#7947)

This commit is contained in:
Patrick Cloke 2020-07-27 14:40:11 -04:00 committed by GitHub
parent 8553f46498
commit 68626ff8e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 131 additions and 107 deletions

View file

@ -17,7 +17,9 @@
import logging
import os
import urllib
from typing import Awaitable
from twisted.internet.interfaces import IConsumer
from twisted.protocols.basic import FileSender
from synapse.api.errors import Codes, SynapseError, cs_error
@ -240,14 +242,14 @@ class Responder(object):
held can be cleaned up.
"""
def write_to_consumer(self, consumer):
def write_to_consumer(self, consumer: IConsumer) -> Awaitable:
"""Stream response into consumer
Args:
consumer (IConsumer)
consumer: The consumer to stream into.
Returns:
Deferred: Resolves once the response has finished being written
Resolves once the response has finished being written
"""
pass