python-socketio-stubs 5.13.0.0.20250802__tar.gz

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.

Files changed (37) hide show
  1. python_socketio_stubs-5.13.0.0.20250802/.gitignore +171 -0
  2. python_socketio_stubs-5.13.0.0.20250802/LICENSE +21 -0
  3. python_socketio_stubs-5.13.0.0.20250802/PKG-INFO +67 -0
  4. python_socketio_stubs-5.13.0.0.20250802/README.md +22 -0
  5. python_socketio_stubs-5.13.0.0.20250802/pyproject.toml +79 -0
  6. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/__init__.pyi +49 -0
  7. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/_types.pyi +196 -0
  8. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/admin.pyi +86 -0
  9. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/asgi.pyi +16 -0
  10. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/async_admin.pyi +80 -0
  11. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/async_aiopika_manager.pyi +22 -0
  12. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/async_client.pyi +85 -0
  13. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/async_manager.pyi +30 -0
  14. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/async_namespace.pyi +103 -0
  15. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/async_pubsub_manager.pyi +43 -0
  16. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/async_redis_manager.pyi +22 -0
  17. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/async_server.pyi +176 -0
  18. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/async_simple_client.pyi +53 -0
  19. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/base_client.pyi +98 -0
  20. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/base_manager.pyi +39 -0
  21. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/base_namespace.pyi +24 -0
  22. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/base_server.pyi +85 -0
  23. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/client.pyi +83 -0
  24. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/exceptions.pyi +14 -0
  25. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/kafka_manager.pyi +15 -0
  26. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/kombu_manager.pyi +26 -0
  27. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/manager.pyi +32 -0
  28. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/middleware.pyi +21 -0
  29. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/msgpack_packet.pyi +12 -0
  30. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/namespace.pyi +99 -0
  31. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/packet.pyi +48 -0
  32. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/pubsub_manager.pyi +43 -0
  33. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/redis_manager.pyi +25 -0
  34. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/server.pyi +132 -0
  35. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/simple_client.pyi +52 -0
  36. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/tornado.pyi +4 -0
  37. python_socketio_stubs-5.13.0.0.20250802/src/socketio-stubs/zmq_manager.pyi +19 -0
@@ -0,0 +1,171 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
159
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160
+ #.idea/
161
+
162
+ *.ipynb
163
+ # asdf
164
+ .tool-versions
165
+ # extra
166
+ .DS_Store
167
+
168
+ # uv
169
+ requirements.lock
170
+ requirements-dev.lock
171
+ uv.lock
@@ -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,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
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
49
+ [![PyPI version](https://badge.fury.io/py/python-socketio-stubs.svg)](https://badge.fury.io/py/joblib-stubs)
50
+ [![python version](https://img.shields.io/pypi/pyversions/python-socketio-stubs.svg)](#)
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,22 @@
1
+ # python-socketio-stubs
2
+
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
+ [![PyPI version](https://badge.fury.io/py/python-socketio-stubs.svg)](https://badge.fury.io/py/joblib-stubs)
5
+ [![python version](https://img.shields.io/pypi/pyversions/python-socketio-stubs.svg)](#)
6
+
7
+ Warning: This library provides type hints only.
8
+ If you need the runtime package,
9
+ you can find it [`python-socketio`](https://github.com/miguelgrinberg/python-socketio).
10
+
11
+ ## how to install
12
+ ```shell
13
+ $ pip install python-socketio-stubs
14
+ ```
15
+
16
+ ## TODO
17
+ * [ ] remove all `Incomplete`
18
+ * [ ] tests?
19
+
20
+ ## License
21
+
22
+ MIT, see [LICENSE](https://github.com/phi-friday/python-socketio-stubs/blob/main/LICENSE).
@@ -0,0 +1,79 @@
1
+ [project]
2
+ name = "python-socketio-stubs"
3
+ version = "5.13.0.0.20250802"
4
+ description = "python-socketio stubs"
5
+ authors = [{ name = "phi", email = "phi.friday@gmail.com" }]
6
+ dependencies = [
7
+ "typing-extensions>=4.4.0",
8
+ ]
9
+ readme = "README.md"
10
+ license = { file = "LICENSE" }
11
+ requires-python = ">= 3.10"
12
+ classifiers = [
13
+ "Development Status :: 4 - Beta",
14
+ "Programming Language :: Python :: 3",
15
+ "Programming Language :: Python :: 3.10",
16
+ "Programming Language :: Python :: 3.11",
17
+ "Programming Language :: Python :: 3.12",
18
+ "Programming Language :: Python :: 3.13",
19
+ "Programming Language :: Python :: Implementation :: CPython",
20
+ "Typing :: Stubs Only",
21
+ ]
22
+
23
+ [project.urls]
24
+ Repository = "https://github.com/phi-friday/python-socketio-stubs"
25
+
26
+ [project.optional-dependencies]
27
+ mypy = [
28
+ "mypy>=1.17.1",
29
+ ]
30
+ mypy-strict = [
31
+ "mypy==1.17.1",
32
+ "python-socketio-stubs[mypy]",
33
+ ]
34
+
35
+ [dependency-groups]
36
+ python-socketio-dependencies = [
37
+ "python-socketio[client,asyncio_client]>=5.13.0",
38
+ "msgpack-types>=0.5.0",
39
+ "eventlet>=0.40.2",
40
+ "tornado>=6.5.1",
41
+ "kombu>=5.5.4",
42
+ "kafka>=1.3.5",
43
+ "gevent>=25.5.1",
44
+ "sanic>=25.3.0",
45
+ "aio-pika>=9.5.5",
46
+ ]
47
+ dev = [
48
+ { include-group = "python-socketio-dependencies" },
49
+ "ruff==0.12.7",
50
+ "pre-commit>=4.2.0",
51
+ "poethepoet>=0.36.0",
52
+ "python-socketio-stubs[mypy-strict]",
53
+ ]
54
+
55
+ [tool.poe.tasks]
56
+ lint = ["_lint:check", "_lint:format"]
57
+ "_lint:check" = "ruff check src --fix"
58
+ "_lint:format" = "ruff format src"
59
+ mypy = "mypy src"
60
+ check = "pre-commit run --all-files --show-diff-on-failure"
61
+
62
+ [build-system]
63
+ requires = ["hatchling"]
64
+ build-backend = "hatchling.build"
65
+
66
+ [tool.hatch.build.targets.wheel]
67
+ packages = ["src/socketio-stubs"]
68
+
69
+ [tool.hatch.build.targets.sdist]
70
+ include = ["src/socketio-stubs"]
71
+
72
+ [tool.mypy]
73
+ python_version = "3.10"
74
+ strict = true
75
+ disable_error_code = "import-untyped,overload-overlap,override"
76
+ disallow_subclassing_any = false
77
+ local_partial_types = true
78
+ ignore_missing_imports = true
79
+ mypy_path = "typings"
@@ -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: ...
@@ -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: ...