python-socketio-stubs 5.13.0.0.20250802__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of python-socketio-stubs might be problematic. Click here for more details.
- python_socketio_stubs-5.13.0.0.20250802.dist-info/METADATA +67 -0
- python_socketio_stubs-5.13.0.0.20250802.dist-info/RECORD +36 -0
- python_socketio_stubs-5.13.0.0.20250802.dist-info/WHEEL +4 -0
- python_socketio_stubs-5.13.0.0.20250802.dist-info/licenses/LICENSE +21 -0
- socketio-stubs/__init__.pyi +49 -0
- socketio-stubs/_types.pyi +196 -0
- socketio-stubs/admin.pyi +86 -0
- socketio-stubs/asgi.pyi +16 -0
- socketio-stubs/async_admin.pyi +80 -0
- socketio-stubs/async_aiopika_manager.pyi +22 -0
- socketio-stubs/async_client.pyi +85 -0
- socketio-stubs/async_manager.pyi +30 -0
- socketio-stubs/async_namespace.pyi +103 -0
- socketio-stubs/async_pubsub_manager.pyi +43 -0
- socketio-stubs/async_redis_manager.pyi +22 -0
- socketio-stubs/async_server.pyi +176 -0
- socketio-stubs/async_simple_client.pyi +53 -0
- socketio-stubs/base_client.pyi +98 -0
- socketio-stubs/base_manager.pyi +39 -0
- socketio-stubs/base_namespace.pyi +24 -0
- socketio-stubs/base_server.pyi +85 -0
- socketio-stubs/client.pyi +83 -0
- socketio-stubs/exceptions.pyi +14 -0
- socketio-stubs/kafka_manager.pyi +15 -0
- socketio-stubs/kombu_manager.pyi +26 -0
- socketio-stubs/manager.pyi +32 -0
- socketio-stubs/middleware.pyi +21 -0
- socketio-stubs/msgpack_packet.pyi +12 -0
- socketio-stubs/namespace.pyi +99 -0
- socketio-stubs/packet.pyi +48 -0
- socketio-stubs/pubsub_manager.pyi +43 -0
- socketio-stubs/redis_manager.pyi +25 -0
- socketio-stubs/server.pyi +132 -0
- socketio-stubs/simple_client.pyi +52 -0
- socketio-stubs/tornado.pyi +4 -0
- socketio-stubs/zmq_manager.pyi +19 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: python-socketio-stubs
|
|
3
|
+
Version: 5.13.0.0.20250802
|
|
4
|
+
Summary: python-socketio stubs
|
|
5
|
+
Project-URL: Repository, https://github.com/phi-friday/python-socketio-stubs
|
|
6
|
+
Author-email: phi <phi.friday@gmail.com>
|
|
7
|
+
License: MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2025 Choi Min-yeong
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Classifier: Development Status :: 4 - Beta
|
|
30
|
+
Classifier: Programming Language :: Python :: 3
|
|
31
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
32
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
35
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
36
|
+
Classifier: Typing :: Stubs Only
|
|
37
|
+
Requires-Python: >=3.10
|
|
38
|
+
Requires-Dist: typing-extensions>=4.4.0
|
|
39
|
+
Provides-Extra: mypy
|
|
40
|
+
Requires-Dist: mypy>=1.17.1; extra == 'mypy'
|
|
41
|
+
Provides-Extra: mypy-strict
|
|
42
|
+
Requires-Dist: mypy==1.17.1; extra == 'mypy-strict'
|
|
43
|
+
Requires-Dist: mypy>=1.17.1; extra == 'mypy-strict'
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
|
|
46
|
+
# python-socketio-stubs
|
|
47
|
+
|
|
48
|
+
[](https://opensource.org/licenses/MIT)
|
|
49
|
+
[](https://badge.fury.io/py/joblib-stubs)
|
|
50
|
+
[](#)
|
|
51
|
+
|
|
52
|
+
Warning: This library provides type hints only.
|
|
53
|
+
If you need the runtime package,
|
|
54
|
+
you can find it [`python-socketio`](https://github.com/miguelgrinberg/python-socketio).
|
|
55
|
+
|
|
56
|
+
## how to install
|
|
57
|
+
```shell
|
|
58
|
+
$ pip install python-socketio-stubs
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## TODO
|
|
62
|
+
* [ ] remove all `Incomplete`
|
|
63
|
+
* [ ] tests?
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
MIT, see [LICENSE](https://github.com/phi-friday/python-socketio-stubs/blob/main/LICENSE).
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
socketio-stubs/__init__.pyi,sha256=bQhayFUg1wLQd7_-nKGs6wh3WJL5E2Y0HYG__mn5zf8,1925
|
|
2
|
+
socketio-stubs/_types.pyi,sha256=XaAugevtOLXyqW2UglVnhWKFFlyTlS1AAfhh0S0Eoi4,6179
|
|
3
|
+
socketio-stubs/admin.pyi,sha256=35GjHiyROigoBrGJXWpJSre27acSGbmb9Ybz8BewSdI,2345
|
|
4
|
+
socketio-stubs/asgi.pyi,sha256=LF7SL44P3Ea4FtFNpYd7McMDWvryiGfbG2S04OSVBvQ,482
|
|
5
|
+
socketio-stubs/async_admin.pyi,sha256=nVt3-6XZeQdn8bAmZSce5q5jRpMd3LtKEcMrxSsOzyA,2238
|
|
6
|
+
socketio-stubs/async_aiopika_manager.pyi,sha256=5vQlp36-D_Ufgj1NpHAn4tM99zbBdLy3j3s0EZRUjPo,610
|
|
7
|
+
socketio-stubs/async_client.pyi,sha256=EtSwc7mbpLKfc4LDPsKgBUEZWMrhM8iyOnlL3mvlbGQ,2932
|
|
8
|
+
socketio-stubs/async_manager.pyi,sha256=zR7qH1u9p3wfL73vSjx7T6zphqGmwNtqD4Q7cLYB1jg,1231
|
|
9
|
+
socketio-stubs/async_namespace.pyi,sha256=h0fsqBzX0Q4K1LsAwETgGzdKXnnxXqG3fpqe4rWzt8g,3708
|
|
10
|
+
socketio-stubs/async_pubsub_manager.pyi,sha256=qHdMZ9VZPbUWIpiePnqPi9RqFZHhV1EamkKbHYRcKtU,1405
|
|
11
|
+
socketio-stubs/async_redis_manager.pyi,sha256=fB7iUMWAI3DMcPG43bWZJwaARDjDRHo1kmsUx1B0b0A,590
|
|
12
|
+
socketio-stubs/async_server.pyi,sha256=TXM3Vbx08ZoMVnXN29-qxHmzXEC3-Ara1w3hp6b1tHg,5785
|
|
13
|
+
socketio-stubs/async_simple_client.pyi,sha256=NUwApnbehoZpRo_8NV8MixTcz9m6MShxM1U5TwIJo0M,1707
|
|
14
|
+
socketio-stubs/base_client.pyi,sha256=T9FJD_pIefMt1R9ysSHN0Q371695HriJC9POz0lSMFA,3331
|
|
15
|
+
socketio-stubs/base_manager.pyi,sha256=1HDPgvUdqwCVOgYLv8IvvsD_gTplfB5mLz_ROcr57zw,1768
|
|
16
|
+
socketio-stubs/base_namespace.pyi,sha256=0VMOHKLYVrXFmZlIoo0-gYJswelWDG7nAlH2rs9AbeI,1056
|
|
17
|
+
socketio-stubs/base_server.pyi,sha256=JAKt_b6qBNbNLzGa3Na_IVLI7ztSkIu-qfrUo76dIZc,2879
|
|
18
|
+
socketio-stubs/client.pyi,sha256=OFK28wep9y8QuuKJkKLBwhyCDaKUk161B-4UyF3vrtk,2826
|
|
19
|
+
socketio-stubs/exceptions.pyi,sha256=q63PYiaWRzn6yymw7JFQWlRApAeOM0puUxZdMo6GZwA,391
|
|
20
|
+
socketio-stubs/kafka_manager.pyi,sha256=sVVLJa1vg08CtWgSOclfQK6oqarxvZun1bQ8YGCI-yY,357
|
|
21
|
+
socketio-stubs/kombu_manager.pyi,sha256=kn1ORnDqzBT5hCGRVCxN2Xv76DytwmHKSjNmLSlOZ4Q,792
|
|
22
|
+
socketio-stubs/manager.pyi,sha256=J_QoBZ7nO0l-c5MplYl1YNK3PyPeabv4RRi3aYDv2jI,1108
|
|
23
|
+
socketio-stubs/middleware.pyi,sha256=n_SHBuccvV01rThw4CugwUvxY5myJ6fGoZW0_mNpzgI,524
|
|
24
|
+
socketio-stubs/msgpack_packet.pyi,sha256=C8t2_0HWS9satLrNAEKXT6ZJPVQbo2yXU2IWwFOzyss,404
|
|
25
|
+
socketio-stubs/namespace.pyi,sha256=rFeYlADrQHo3ceuXvcagh8xPt0iiW0TSmZ8aZXZompc,3532
|
|
26
|
+
socketio-stubs/packet.pyi,sha256=37R5Xg_P5fxFYgVErCmLwwlSmiaIujVCQNP3-whT9K0,1276
|
|
27
|
+
socketio-stubs/pubsub_manager.pyi,sha256=NbtjSV_2gRN1gqDIYHkeb7fMVrvqfyoJ9FI4IKZNV7U,1351
|
|
28
|
+
socketio-stubs/redis_manager.pyi,sha256=ieQsx4y2faIXeYdd7SQVJD-ALeitvMAYYmM6IeIekFY,631
|
|
29
|
+
socketio-stubs/server.pyi,sha256=D9NBxazkpyOQQRyUyGafgStZ9roGCN9f6LqSz0Tzce4,4521
|
|
30
|
+
socketio-stubs/simple_client.pyi,sha256=YHu6snuCARleORPPT_y6K-hzIeoOCEVXAjQVNLVDwxc,1605
|
|
31
|
+
socketio-stubs/tornado.pyi,sha256=Olvv6K-4uSCwIbJgrz7fE4cB4focDvSCNs7fGvCFFos,157
|
|
32
|
+
socketio-stubs/zmq_manager.pyi,sha256=RAVpSsTHFf9PiPVO_GCTdbUNJ8SyOiR2G9i0H9TtcRk,484
|
|
33
|
+
python_socketio_stubs-5.13.0.0.20250802.dist-info/METADATA,sha256=eM90u-q48iTtJZrwxAoruCkYLbqKGob1xRyy6l0Jjbk,2916
|
|
34
|
+
python_socketio_stubs-5.13.0.0.20250802.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
35
|
+
python_socketio_stubs-5.13.0.0.20250802.dist-info/licenses/LICENSE,sha256=nr5J-S3pea-dsAcBeMDQuEC0Gaz-mXEz2t3lBlnCz94,1070
|
|
36
|
+
python_socketio_stubs-5.13.0.0.20250802.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Choi Min-yeong
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
from socketio.asgi import ASGIApp as ASGIApp
|
|
2
|
+
from socketio.async_aiopika_manager import AsyncAioPikaManager as AsyncAioPikaManager
|
|
3
|
+
from socketio.async_client import AsyncClient as AsyncClient
|
|
4
|
+
from socketio.async_manager import AsyncManager as AsyncManager
|
|
5
|
+
from socketio.async_namespace import AsyncClientNamespace as AsyncClientNamespace
|
|
6
|
+
from socketio.async_namespace import AsyncNamespace as AsyncNamespace
|
|
7
|
+
from socketio.async_redis_manager import AsyncRedisManager as AsyncRedisManager
|
|
8
|
+
from socketio.async_server import AsyncServer as AsyncServer
|
|
9
|
+
from socketio.async_simple_client import AsyncSimpleClient as AsyncSimpleClient
|
|
10
|
+
from socketio.client import Client as Client
|
|
11
|
+
from socketio.kafka_manager import KafkaManager as KafkaManager
|
|
12
|
+
from socketio.kombu_manager import KombuManager as KombuManager
|
|
13
|
+
from socketio.manager import Manager as Manager
|
|
14
|
+
from socketio.middleware import Middleware as Middleware
|
|
15
|
+
from socketio.middleware import WSGIApp as WSGIApp
|
|
16
|
+
from socketio.namespace import ClientNamespace as ClientNamespace
|
|
17
|
+
from socketio.namespace import Namespace as Namespace
|
|
18
|
+
from socketio.pubsub_manager import PubSubManager as PubSubManager
|
|
19
|
+
from socketio.redis_manager import RedisManager as RedisManager
|
|
20
|
+
from socketio.server import Server as Server
|
|
21
|
+
from socketio.simple_client import SimpleClient as SimpleClient
|
|
22
|
+
from socketio.tornado import get_tornado_handler as get_tornado_handler
|
|
23
|
+
from socketio.zmq_manager import ZmqManager as ZmqManager
|
|
24
|
+
|
|
25
|
+
__all__ = [
|
|
26
|
+
"ASGIApp",
|
|
27
|
+
"AsyncAioPikaManager",
|
|
28
|
+
"AsyncClient",
|
|
29
|
+
"AsyncClientNamespace",
|
|
30
|
+
"AsyncManager",
|
|
31
|
+
"AsyncNamespace",
|
|
32
|
+
"AsyncRedisManager",
|
|
33
|
+
"AsyncServer",
|
|
34
|
+
"AsyncSimpleClient",
|
|
35
|
+
"Client",
|
|
36
|
+
"ClientNamespace",
|
|
37
|
+
"KafkaManager",
|
|
38
|
+
"KombuManager",
|
|
39
|
+
"Manager",
|
|
40
|
+
"Middleware",
|
|
41
|
+
"Namespace",
|
|
42
|
+
"PubSubManager",
|
|
43
|
+
"RedisManager",
|
|
44
|
+
"Server",
|
|
45
|
+
"SimpleClient",
|
|
46
|
+
"WSGIApp",
|
|
47
|
+
"ZmqManager",
|
|
48
|
+
"get_tornado_handler",
|
|
49
|
+
]
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
from contextlib import AbstractAsyncContextManager, AbstractContextManager
|
|
2
|
+
from threading import Event as ThreadingEvent
|
|
3
|
+
from typing import Any, Literal, TypeAlias, overload
|
|
4
|
+
|
|
5
|
+
from _typeshed import Incomplete
|
|
6
|
+
from engineio.async_drivers.eventlet import EventletThread
|
|
7
|
+
from engineio.async_drivers.gevent import Thread as GeventThread
|
|
8
|
+
from engineio.async_drivers.gevent_uwsgi import Thread as GeventUWSGThread
|
|
9
|
+
from engineio.async_drivers.threading import DaemonThread
|
|
10
|
+
from engineio.socket import Socket
|
|
11
|
+
from gevent.event import Event as GeventEvent
|
|
12
|
+
from socketio.admin import InstrumentedServer
|
|
13
|
+
from socketio.server import Server
|
|
14
|
+
from typing_extensions import NotRequired, Required, TypedDict
|
|
15
|
+
|
|
16
|
+
DataType: TypeAlias = str | bytes | list[Incomplete] | dict[Incomplete, Incomplete]
|
|
17
|
+
TransportType: TypeAlias = Literal["websocket", "polling"]
|
|
18
|
+
SocketIOModeType: TypeAlias = Literal["development", "production"]
|
|
19
|
+
SyncAsyncModeType: TypeAlias = Literal[
|
|
20
|
+
"eventlet", "gevent_uwsgi", "gevent", "threading"
|
|
21
|
+
]
|
|
22
|
+
AsyncAsyncModeType: TypeAlias = Literal["aiohttp", "sanic", "tornado", "asgi"]
|
|
23
|
+
|
|
24
|
+
class SessionContextManager(AbstractContextManager[Socket]):
|
|
25
|
+
server: Server[Any]
|
|
26
|
+
sid: str
|
|
27
|
+
namespace: str | None
|
|
28
|
+
session: Socket | None
|
|
29
|
+
|
|
30
|
+
def __enter__(self) -> Socket: ...
|
|
31
|
+
def __exit__(self, *args: object, **kwargs: Any) -> None: ...
|
|
32
|
+
|
|
33
|
+
class AsyncSessionContextManager(AbstractAsyncContextManager[Socket]):
|
|
34
|
+
server: Server[Any]
|
|
35
|
+
sid: str
|
|
36
|
+
namespace: str | None
|
|
37
|
+
session: Socket | None
|
|
38
|
+
|
|
39
|
+
async def __aenter__(self) -> Socket: ...
|
|
40
|
+
async def __aexit__(self, *args: object, **kwargs: Any) -> None: ...
|
|
41
|
+
|
|
42
|
+
class BufferItem(TypedDict, total=True):
|
|
43
|
+
timestamp: int
|
|
44
|
+
type: str
|
|
45
|
+
count: int
|
|
46
|
+
|
|
47
|
+
class SerializedSocketHandshake(TypedDict, total=True):
|
|
48
|
+
address: str
|
|
49
|
+
headers: dict[str, Incomplete]
|
|
50
|
+
query: dict[str, str]
|
|
51
|
+
secure: bool
|
|
52
|
+
url: str
|
|
53
|
+
issued: int
|
|
54
|
+
time: str
|
|
55
|
+
|
|
56
|
+
class SerializedSocket(TypedDict, total=True):
|
|
57
|
+
id: str
|
|
58
|
+
clientId: str
|
|
59
|
+
transport: TransportType
|
|
60
|
+
nsp: str
|
|
61
|
+
data: dict[Incomplete, Incomplete]
|
|
62
|
+
handshake: SerializedSocketHandshake
|
|
63
|
+
rooms: list[str]
|
|
64
|
+
|
|
65
|
+
class ErrorArgs(TypedDict, total=False):
|
|
66
|
+
message: Required[str]
|
|
67
|
+
data: NotRequired[Any]
|
|
68
|
+
|
|
69
|
+
class RedisArgs(TypedDict, total=False):
|
|
70
|
+
username: str
|
|
71
|
+
password: str
|
|
72
|
+
db: int
|
|
73
|
+
|
|
74
|
+
class StopStateEventDescriptor:
|
|
75
|
+
@overload
|
|
76
|
+
def __get__(
|
|
77
|
+
self,
|
|
78
|
+
instance: InstrumentedServer[Literal["gevent_uwsgi"]],
|
|
79
|
+
owner: type[InstrumentedServer[Any]],
|
|
80
|
+
) -> GeventEvent | None: ...
|
|
81
|
+
@overload
|
|
82
|
+
def __get__(
|
|
83
|
+
self,
|
|
84
|
+
instance: InstrumentedServer[Literal["gevent"]],
|
|
85
|
+
owner: type[InstrumentedServer[Any]],
|
|
86
|
+
) -> GeventEvent | None: ...
|
|
87
|
+
@overload
|
|
88
|
+
def __get__(
|
|
89
|
+
self,
|
|
90
|
+
instance: InstrumentedServer[Literal["eventlet"]],
|
|
91
|
+
owner: type[InstrumentedServer[Any]],
|
|
92
|
+
) -> ThreadingEvent | None: ...
|
|
93
|
+
@overload
|
|
94
|
+
def __get__(
|
|
95
|
+
self,
|
|
96
|
+
instance: InstrumentedServer[Literal["threading"]],
|
|
97
|
+
owner: type[InstrumentedServer[Any]],
|
|
98
|
+
) -> ThreadingEvent | None: ...
|
|
99
|
+
@overload
|
|
100
|
+
def __get__(
|
|
101
|
+
self,
|
|
102
|
+
instance: InstrumentedServer[SyncAsyncModeType],
|
|
103
|
+
owner: type[InstrumentedServer[SyncAsyncModeType]],
|
|
104
|
+
) -> ThreadingEvent | GeventEvent | None: ...
|
|
105
|
+
@overload
|
|
106
|
+
def __set__(
|
|
107
|
+
self,
|
|
108
|
+
instance: InstrumentedServer[Literal["gevent_uwsgi"]],
|
|
109
|
+
value: GeventEvent | None,
|
|
110
|
+
) -> None: ...
|
|
111
|
+
@overload
|
|
112
|
+
def __set__(
|
|
113
|
+
self, instance: InstrumentedServer[Literal["gevent"]], value: GeventEvent | None
|
|
114
|
+
) -> None: ...
|
|
115
|
+
@overload
|
|
116
|
+
def __set__(
|
|
117
|
+
self,
|
|
118
|
+
instance: InstrumentedServer[Literal["eventlet"]],
|
|
119
|
+
value: ThreadingEvent | None,
|
|
120
|
+
) -> None: ...
|
|
121
|
+
@overload
|
|
122
|
+
def __set__(
|
|
123
|
+
self,
|
|
124
|
+
instance: InstrumentedServer[Literal["threading"]],
|
|
125
|
+
value: ThreadingEvent | None,
|
|
126
|
+
) -> None: ...
|
|
127
|
+
@overload
|
|
128
|
+
def __set__(
|
|
129
|
+
self,
|
|
130
|
+
instance: InstrumentedServer[SyncAsyncModeType],
|
|
131
|
+
value: ThreadingEvent | GeventEvent | None,
|
|
132
|
+
) -> None: ...
|
|
133
|
+
def __delete__(self, instance: InstrumentedServer[Any]) -> None: ...
|
|
134
|
+
|
|
135
|
+
class StatsTaskDescriptor:
|
|
136
|
+
@overload
|
|
137
|
+
def __get__(
|
|
138
|
+
self,
|
|
139
|
+
instance: InstrumentedServer[Literal["eventlet"]],
|
|
140
|
+
owner: type[InstrumentedServer[Literal["eventlet"]]],
|
|
141
|
+
) -> EventletThread | None: ...
|
|
142
|
+
@overload
|
|
143
|
+
def __get__(
|
|
144
|
+
self,
|
|
145
|
+
instance: InstrumentedServer[Literal["gevent_uwsgi"]],
|
|
146
|
+
owner: type[InstrumentedServer[Literal["gevent_uwsgi",]]],
|
|
147
|
+
) -> GeventUWSGThread | None: ...
|
|
148
|
+
@overload
|
|
149
|
+
def __get__(
|
|
150
|
+
self,
|
|
151
|
+
instance: InstrumentedServer[Literal["gevent"]],
|
|
152
|
+
owner: type[InstrumentedServer[Literal["gevent"]]],
|
|
153
|
+
) -> GeventThread | None: ...
|
|
154
|
+
@overload
|
|
155
|
+
def __get__(
|
|
156
|
+
self,
|
|
157
|
+
instance: InstrumentedServer[Literal["threading"]],
|
|
158
|
+
owner: type[InstrumentedServer[Literal["threading"]]],
|
|
159
|
+
) -> DaemonThread | None: ...
|
|
160
|
+
@overload
|
|
161
|
+
def __get__(
|
|
162
|
+
self,
|
|
163
|
+
instance: InstrumentedServer[SyncAsyncModeType],
|
|
164
|
+
owner: type[InstrumentedServer[SyncAsyncModeType]],
|
|
165
|
+
) -> EventletThread | GeventUWSGThread | GeventThread | DaemonThread | None: ...
|
|
166
|
+
@overload
|
|
167
|
+
def __set__(
|
|
168
|
+
self,
|
|
169
|
+
instance: InstrumentedServer[Literal["eventlet",]],
|
|
170
|
+
value: EventletThread | None,
|
|
171
|
+
) -> None: ...
|
|
172
|
+
@overload
|
|
173
|
+
def __set__(
|
|
174
|
+
self,
|
|
175
|
+
instance: InstrumentedServer[Literal["gevent_uwsgi"]],
|
|
176
|
+
value: GeventUWSGThread | None,
|
|
177
|
+
) -> None: ...
|
|
178
|
+
@overload
|
|
179
|
+
def __set__(
|
|
180
|
+
self,
|
|
181
|
+
instance: InstrumentedServer[Literal["gevent"]],
|
|
182
|
+
value: GeventThread | None,
|
|
183
|
+
) -> None: ...
|
|
184
|
+
@overload
|
|
185
|
+
def __set__(
|
|
186
|
+
self,
|
|
187
|
+
instance: InstrumentedServer[Literal["threading"]],
|
|
188
|
+
value: DaemonThread | None,
|
|
189
|
+
) -> None: ...
|
|
190
|
+
@overload
|
|
191
|
+
def __set__(
|
|
192
|
+
self,
|
|
193
|
+
instance: InstrumentedServer[SyncAsyncModeType],
|
|
194
|
+
value: EventletThread | GeventUWSGThread | GeventThread | DaemonThread | None,
|
|
195
|
+
) -> None: ...
|
|
196
|
+
def __delete__(self, instance: InstrumentedServer[Any]) -> None: ...
|
socketio-stubs/admin.pyi
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
from collections.abc import Mapping, Sequence
|
|
2
|
+
from typing import Any, Generic
|
|
3
|
+
|
|
4
|
+
from _typeshed import Incomplete
|
|
5
|
+
from socketio._types import (
|
|
6
|
+
BufferItem,
|
|
7
|
+
DataType,
|
|
8
|
+
SerializedSocket,
|
|
9
|
+
SocketIOModeType,
|
|
10
|
+
StatsTaskDescriptor,
|
|
11
|
+
StopStateEventDescriptor,
|
|
12
|
+
SyncAsyncModeType,
|
|
13
|
+
)
|
|
14
|
+
from socketio.server import Server
|
|
15
|
+
from typing_extensions import TypeVar
|
|
16
|
+
|
|
17
|
+
_A = TypeVar("_A", bound=SyncAsyncModeType, default=Any)
|
|
18
|
+
|
|
19
|
+
HOSTNAME: str
|
|
20
|
+
PID: int
|
|
21
|
+
|
|
22
|
+
class EventBuffer:
|
|
23
|
+
buffer: dict[str, BufferItem]
|
|
24
|
+
def __init__(self) -> None: ...
|
|
25
|
+
def push(self, type: str, count: int = ...) -> None: ...
|
|
26
|
+
def get_and_clear(self) -> list[BufferItem]: ...
|
|
27
|
+
|
|
28
|
+
class InstrumentedServer(Generic[_A]):
|
|
29
|
+
sio: Server[_A]
|
|
30
|
+
auth: Incomplete
|
|
31
|
+
admin_namespace: str
|
|
32
|
+
read_only: bool
|
|
33
|
+
server_id: str
|
|
34
|
+
mode: SocketIOModeType
|
|
35
|
+
server_stats_interval: int
|
|
36
|
+
event_buffer: EventBuffer
|
|
37
|
+
stop_stats_event: StopStateEventDescriptor
|
|
38
|
+
stats_task: StatsTaskDescriptor
|
|
39
|
+
def __init__(
|
|
40
|
+
self,
|
|
41
|
+
sio: Server[_A],
|
|
42
|
+
auth: Incomplete | None = ...,
|
|
43
|
+
mode: SocketIOModeType = ...,
|
|
44
|
+
read_only: bool = ...,
|
|
45
|
+
server_id: str | None = ...,
|
|
46
|
+
namespace: str = ...,
|
|
47
|
+
server_stats_interval: int = ...,
|
|
48
|
+
) -> None: ...
|
|
49
|
+
def instrument(self) -> None: ...
|
|
50
|
+
def uninstrument(self) -> None: ...
|
|
51
|
+
def admin_connect(
|
|
52
|
+
self, sid: str, environ: Mapping[str, Incomplete], client_auth: Incomplete
|
|
53
|
+
) -> None: ...
|
|
54
|
+
def admin_emit(
|
|
55
|
+
self,
|
|
56
|
+
_: Any,
|
|
57
|
+
namespace: str | None,
|
|
58
|
+
room_filter: str | None,
|
|
59
|
+
event: str,
|
|
60
|
+
*data: DataType,
|
|
61
|
+
) -> None: ...
|
|
62
|
+
def admin_enter_room(
|
|
63
|
+
self,
|
|
64
|
+
_: Any,
|
|
65
|
+
namespace: str | None,
|
|
66
|
+
room: str,
|
|
67
|
+
room_filter: str | Sequence[str] | None = ...,
|
|
68
|
+
) -> None: ...
|
|
69
|
+
def admin_leave_room(
|
|
70
|
+
self,
|
|
71
|
+
_: Any,
|
|
72
|
+
namespace: str | None,
|
|
73
|
+
room: str,
|
|
74
|
+
room_filter: str | Sequence[str] | None = ...,
|
|
75
|
+
) -> None: ...
|
|
76
|
+
def admin_disconnect(
|
|
77
|
+
self,
|
|
78
|
+
_: Any,
|
|
79
|
+
namespace: str | None,
|
|
80
|
+
close: Any,
|
|
81
|
+
room_filter: str | Sequence[str] | None = ...,
|
|
82
|
+
) -> None: ...
|
|
83
|
+
def shutdown(self) -> None: ...
|
|
84
|
+
def serialize_socket(
|
|
85
|
+
self, sid: str, namespace: str, eio_sid: str | None = ...
|
|
86
|
+
) -> SerializedSocket: ...
|
socketio-stubs/asgi.pyi
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from collections.abc import Callable
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import engineio
|
|
5
|
+
from socketio.async_server import AsyncServer
|
|
6
|
+
|
|
7
|
+
class ASGIApp(engineio.ASGIApp):
|
|
8
|
+
def __init__(
|
|
9
|
+
self,
|
|
10
|
+
socketio_server: AsyncServer,
|
|
11
|
+
other_asgi_app: Any = ...,
|
|
12
|
+
static_files: dict[str, dict[str, str]] | None = ...,
|
|
13
|
+
socketio_path: str = ...,
|
|
14
|
+
on_startup: Callable[[], Any] | None = ...,
|
|
15
|
+
on_shutdown: Callable[[], Any] | None = ...,
|
|
16
|
+
) -> None: ...
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
from collections.abc import Mapping, Sequence
|
|
3
|
+
from typing import Any, Generic
|
|
4
|
+
|
|
5
|
+
from _typeshed import Incomplete
|
|
6
|
+
from socketio._types import (
|
|
7
|
+
AsyncAsyncModeType,
|
|
8
|
+
DataType,
|
|
9
|
+
SerializedSocket,
|
|
10
|
+
SocketIOModeType,
|
|
11
|
+
)
|
|
12
|
+
from socketio.admin import EventBuffer as EventBuffer
|
|
13
|
+
from socketio.async_server import AsyncServer
|
|
14
|
+
from typing_extensions import TypeVar
|
|
15
|
+
|
|
16
|
+
_A = TypeVar("_A", bound=AsyncAsyncModeType, default=Any)
|
|
17
|
+
|
|
18
|
+
HOSTNAME: str
|
|
19
|
+
PID: int
|
|
20
|
+
|
|
21
|
+
class InstrumentedAsyncServer(Generic[_A]):
|
|
22
|
+
sio: AsyncServer[_A]
|
|
23
|
+
auth: Incomplete
|
|
24
|
+
admin_namespace: str
|
|
25
|
+
read_only: bool
|
|
26
|
+
server_id: str
|
|
27
|
+
mode: SocketIOModeType
|
|
28
|
+
server_stats_interval: int
|
|
29
|
+
admin_queue: list[Incomplete]
|
|
30
|
+
event_buffer: EventBuffer
|
|
31
|
+
stop_stats_event: asyncio.Event | None
|
|
32
|
+
stats_task: asyncio.Task[Any] | None
|
|
33
|
+
def __init__(
|
|
34
|
+
self,
|
|
35
|
+
sio: AsyncServer[_A],
|
|
36
|
+
auth: Incomplete | None = ...,
|
|
37
|
+
namespace: str = ...,
|
|
38
|
+
read_only: bool = ...,
|
|
39
|
+
server_id: str | None = ...,
|
|
40
|
+
mode: SocketIOModeType = ...,
|
|
41
|
+
server_stats_interval: int = ...,
|
|
42
|
+
) -> None: ...
|
|
43
|
+
def instrument(self) -> None: ...
|
|
44
|
+
def uninstrument(self) -> None: ...
|
|
45
|
+
async def admin_connect(
|
|
46
|
+
self, sid: str, environ: Mapping[str, Incomplete], client_auth: Incomplete
|
|
47
|
+
) -> None: ...
|
|
48
|
+
async def admin_emit(
|
|
49
|
+
self,
|
|
50
|
+
_: Any,
|
|
51
|
+
namespace: str | None,
|
|
52
|
+
room_filter: str | None,
|
|
53
|
+
event: str,
|
|
54
|
+
*data: DataType,
|
|
55
|
+
) -> None: ...
|
|
56
|
+
async def admin_enter_room(
|
|
57
|
+
self,
|
|
58
|
+
_: Any,
|
|
59
|
+
namespace: str | None,
|
|
60
|
+
room: str,
|
|
61
|
+
room_filter: str | Sequence[str] | None = ...,
|
|
62
|
+
) -> None: ...
|
|
63
|
+
async def admin_leave_room(
|
|
64
|
+
self,
|
|
65
|
+
_: Any,
|
|
66
|
+
namespace: str | None,
|
|
67
|
+
room: str,
|
|
68
|
+
room_filter: str | Sequence[str] | None = ...,
|
|
69
|
+
) -> None: ...
|
|
70
|
+
async def admin_disconnect(
|
|
71
|
+
self,
|
|
72
|
+
_: Any,
|
|
73
|
+
namespace: str | None,
|
|
74
|
+
close: Any,
|
|
75
|
+
room_filter: str | Sequence[str] | None = ...,
|
|
76
|
+
) -> None: ...
|
|
77
|
+
async def shutdown(self) -> None: ...
|
|
78
|
+
def serialize_socket(
|
|
79
|
+
self, sid: str, namespace: str, eio_sid: str | None = ...
|
|
80
|
+
) -> SerializedSocket: ...
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
|
|
3
|
+
from aio_pika.abc import (
|
|
4
|
+
AbstractRobustChannel,
|
|
5
|
+
AbstractRobustConnection,
|
|
6
|
+
AbstractRobustExchange,
|
|
7
|
+
)
|
|
8
|
+
from socketio.async_pubsub_manager import AsyncPubSubManager
|
|
9
|
+
|
|
10
|
+
class AsyncAioPikaManager(AsyncPubSubManager):
|
|
11
|
+
name: str
|
|
12
|
+
url: str
|
|
13
|
+
publisher_connection: AbstractRobustConnection | None
|
|
14
|
+
publisher_channel: AbstractRobustChannel | None
|
|
15
|
+
publisher_exchange: AbstractRobustExchange | None
|
|
16
|
+
def __init__(
|
|
17
|
+
self,
|
|
18
|
+
url: str = ...,
|
|
19
|
+
channel: str = ...,
|
|
20
|
+
write_only: bool = ...,
|
|
21
|
+
logger: logging.Logger | None = ...,
|
|
22
|
+
) -> None: ...
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import logging
|
|
3
|
+
from collections.abc import Awaitable, Callable
|
|
4
|
+
from typing import Any, Literal, ParamSpec, TypeVar
|
|
5
|
+
|
|
6
|
+
import engineio
|
|
7
|
+
import requests
|
|
8
|
+
from _typeshed import Incomplete
|
|
9
|
+
from socketio._types import DataType, TransportType
|
|
10
|
+
from socketio.base_client import BaseClient
|
|
11
|
+
|
|
12
|
+
_T = TypeVar("_T")
|
|
13
|
+
_P = ParamSpec("_P")
|
|
14
|
+
|
|
15
|
+
default_logger: logging.Logger
|
|
16
|
+
|
|
17
|
+
class AsyncClient(BaseClient[Literal[True], engineio.AsyncClient]):
|
|
18
|
+
connection_url: str # pyright: ignore[reportIncompatibleVariableOverride]
|
|
19
|
+
connection_headers: dict[Incomplete, Incomplete] # pyright: ignore[reportIncompatibleVariableOverride]
|
|
20
|
+
connection_auth: Incomplete | None
|
|
21
|
+
connection_transports: TransportType | None
|
|
22
|
+
connection_namespaces: list[str]
|
|
23
|
+
socketio_path: str # pyright: ignore[reportIncompatibleVariableOverride]
|
|
24
|
+
namespaces: dict[str, str | None]
|
|
25
|
+
connected: bool
|
|
26
|
+
|
|
27
|
+
def __init__(
|
|
28
|
+
self,
|
|
29
|
+
reconnection: bool = ...,
|
|
30
|
+
reconnection_attempts: int = ...,
|
|
31
|
+
reconnection_delay: int = ...,
|
|
32
|
+
reconnection_delay_max: int = ...,
|
|
33
|
+
randomization_factor: float = ...,
|
|
34
|
+
logger: logging.Logger | bool = ...,
|
|
35
|
+
serializer: str = ...,
|
|
36
|
+
json: Incomplete | None = ...,
|
|
37
|
+
handle_sigint: bool = ...,
|
|
38
|
+
# engineio options
|
|
39
|
+
*,
|
|
40
|
+
request_timeout: int = ...,
|
|
41
|
+
http_session: requests.Session | None = ...,
|
|
42
|
+
ssl_verify: bool = ...,
|
|
43
|
+
websocket_extra_options: dict[str, Any] | None = ...,
|
|
44
|
+
engineio_logger: logging.Logger | bool = ...,
|
|
45
|
+
**kwargs: Incomplete,
|
|
46
|
+
) -> None: ...
|
|
47
|
+
async def connect(
|
|
48
|
+
self,
|
|
49
|
+
url: str,
|
|
50
|
+
headers: dict[Incomplete, Incomplete] = ...,
|
|
51
|
+
auth: Incomplete | None = ...,
|
|
52
|
+
transports: TransportType | None = ...,
|
|
53
|
+
namespaces: str | list[str] | None = ...,
|
|
54
|
+
socketio_path: str = ...,
|
|
55
|
+
wait: bool = ...,
|
|
56
|
+
wait_timeout: int = ...,
|
|
57
|
+
retry: bool = ...,
|
|
58
|
+
) -> None: ...
|
|
59
|
+
async def wait(self) -> None: ...
|
|
60
|
+
async def emit(
|
|
61
|
+
self,
|
|
62
|
+
event: str,
|
|
63
|
+
data: DataType | tuple[DataType, ...] | None = ...,
|
|
64
|
+
namespace: str | None = ...,
|
|
65
|
+
callback: Callable[..., Incomplete] = ...,
|
|
66
|
+
) -> None: ...
|
|
67
|
+
async def send(
|
|
68
|
+
self,
|
|
69
|
+
data: DataType | tuple[DataType, ...] | None,
|
|
70
|
+
namespace: str | None = ...,
|
|
71
|
+
callback: Callable[..., Incomplete] = ...,
|
|
72
|
+
) -> None: ...
|
|
73
|
+
async def call(
|
|
74
|
+
self,
|
|
75
|
+
event: str,
|
|
76
|
+
data: DataType | tuple[DataType, ...] | None = ...,
|
|
77
|
+
namespace: str | None = ...,
|
|
78
|
+
timeout: int = ...,
|
|
79
|
+
) -> Incomplete | None: ...
|
|
80
|
+
async def disconnect(self) -> None: ...
|
|
81
|
+
async def shutdown(self) -> None: ...
|
|
82
|
+
def start_background_task(
|
|
83
|
+
self, target: Callable[_P, Awaitable[_T]], *args: _P.args, **kwargs: _P.kwargs
|
|
84
|
+
) -> asyncio.Task[_T]: ...
|
|
85
|
+
async def sleep(self, seconds: int = ...) -> None: ...
|