diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-07-27 14:40:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-27 14:40:11 -0400 |
commit | 68626ff8e98443d6dc470970274a853a93fceefa (patch) | |
tree | 1087ee686a7560ba96a40f3ad2ebc45b0b84dc13 /synapse/rest/media/v1/_base.py | |
parent | Convert a synapse.events to async/await. (#7949) (diff) | |
download | synapse-68626ff8e98443d6dc470970274a853a93fceefa.tar.xz |
Convert the remaining media repo code to async / await. (#7947)
Diffstat (limited to 'synapse/rest/media/v1/_base.py')
-rw-r--r-- | synapse/rest/media/v1/_base.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/rest/media/v1/_base.py b/synapse/rest/media/v1/_base.py index 9a847130c0..20ddb9550b 100644 --- a/synapse/rest/media/v1/_base.py +++ b/synapse/rest/media/v1/_base.py @@ -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 |