/
futures.py
66 lines (51 loc) · 1.33 KB
/
futures.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from pathlib import PurePath
from typing import Dict, Iterable, List, NamedTuple, Optional, Union
from sanic.models.handler_types import (
ErrorMiddlewareType,
ListenerType,
MiddlewareType,
SignalHandler,
)
class FutureRoute(NamedTuple):
handler: str
uri: str
methods: Optional[Iterable[str]]
host: str
strict_slashes: bool
stream: bool
version: Optional[int]
name: str
ignore_body: bool
websocket: bool
subprotocols: Optional[List[str]]
unquote: bool
static: bool
version_prefix: str
error_format: Optional[str]
class FutureListener(NamedTuple):
listener: ListenerType
event: str
class FutureMiddleware(NamedTuple):
middleware: MiddlewareType
attach_to: str
class FutureException(NamedTuple):
handler: ErrorMiddlewareType
exceptions: List[BaseException]
class FutureStatic(NamedTuple):
uri: str
file_or_directory: Union[str, bytes, PurePath]
pattern: str
use_modified_since: bool
use_content_range: bool
stream_large_files: bool
name: str
host: Optional[str]
strict_slashes: Optional[bool]
content_type: Optional[bool]
resource_type: Optional[str]
class FutureSignal(NamedTuple):
handler: SignalHandler
event: str
condition: Optional[Dict[str, str]]
class FutureRegistry(set):
...