mirror of
https://github.com/element-hq/synapse
synced 2024-09-12 07:05:12 +00:00
A bit more paramspec
This commit is contained in:
parent
dd70d11373
commit
9b6764b2ef
1 changed files with 3 additions and 2 deletions
|
@ -100,6 +100,7 @@ logger = logging.getLogger(__name__)
|
|||
# the type of thing that can be passed into `make_request` in the headers list
|
||||
CustomHeaderType = Tuple[Union[str, bytes], Union[str, bytes]]
|
||||
P = ParamSpec("P")
|
||||
R = TypeVar("R")
|
||||
|
||||
|
||||
class TimedOutException(Exception):
|
||||
|
@ -559,7 +560,7 @@ def _make_test_homeserver_synchronous(server: HomeServer) -> None:
|
|||
for database in server.get_datastores().databases:
|
||||
pool = database._db_pool
|
||||
|
||||
def runWithConnection(func, *args, **kwargs):
|
||||
def runWithConnection(func: Callable[P, R], *args: P.args, **kwargs: P.kwargs) -> "Deferred[R]":
|
||||
return threads.deferToThreadPool(
|
||||
pool._reactor,
|
||||
pool.threadpool,
|
||||
|
@ -569,7 +570,7 @@ def _make_test_homeserver_synchronous(server: HomeServer) -> None:
|
|||
**kwargs,
|
||||
)
|
||||
|
||||
def runInteraction(interaction, *args, **kwargs):
|
||||
def runInteraction(interaction: Callable[P, R], *args: P.args, **kwargs: P.kwargs) -> "Deferred[R]":
|
||||
return threads.deferToThreadPool(
|
||||
pool._reactor,
|
||||
pool.threadpool,
|
||||
|
|
Loading…
Reference in a new issue