python-socketio 5.11.3__tar.gz → 5.12.0__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.
- {python_socketio-5.11.3/src/python_socketio.egg-info → python_socketio-5.12.0}/PKG-INFO +2 -2
- {python_socketio-5.11.3 → python_socketio-5.12.0}/docs/client.rst +18 -5
- {python_socketio-5.11.3 → python_socketio-5.12.0}/docs/server.rst +634 -493
- {python_socketio-5.11.3 → python_socketio-5.12.0}/pyproject.toml +6 -2
- {python_socketio-5.11.3 → python_socketio-5.12.0/src/python_socketio.egg-info}/PKG-INFO +2 -2
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/python_socketio.egg-info/SOURCES.txt +0 -1
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/python_socketio.egg-info/requires.txt +1 -1
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/admin.py +1 -1
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/async_client.py +30 -12
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/async_manager.py +2 -1
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/async_namespace.py +38 -6
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/async_pubsub_manager.py +2 -1
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/async_server.py +26 -9
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/base_client.py +4 -1
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/base_manager.py +1 -2
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/base_namespace.py +1 -1
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/base_server.py +3 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/client.py +22 -9
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/kafka_manager.py +1 -2
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/kombu_manager.py +1 -1
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/manager.py +2 -1
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/namespace.py +18 -4
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/packet.py +1 -1
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/pubsub_manager.py +2 -1
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/redis_manager.py +1 -2
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/server.py +19 -9
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/zmq_manager.py +1 -1
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/async/test_admin.py +20 -21
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/async/test_client.py +485 -503
- python_socketio-5.12.0/tests/async/test_manager.py +382 -0
- python_socketio-5.12.0/tests/async/test_namespace.py +390 -0
- python_socketio-5.12.0/tests/async/test_pubsub_manager.py +555 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/async/test_server.py +442 -432
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/async/test_simple_client.py +54 -56
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/common/test_admin.py +19 -19
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/common/test_client.py +36 -41
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/common/test_manager.py +4 -5
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/common/test_middleware.py +1 -2
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/common/test_msgpack_packet.py +1 -3
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/common/test_namespace.py +38 -3
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/common/test_packet.py +1 -3
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/common/test_pubsub_manager.py +18 -3
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/common/test_server.py +31 -16
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/common/test_simple_client.py +1 -2
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tox.ini +3 -1
- python_socketio-5.11.3/tests/async/helpers.py +0 -18
- python_socketio-5.11.3/tests/async/test_manager.py +0 -407
- python_socketio-5.11.3/tests/async/test_namespace.py +0 -342
- python_socketio-5.11.3/tests/async/test_pubsub_manager.py +0 -587
- {python_socketio-5.11.3 → python_socketio-5.12.0}/LICENSE +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/MANIFEST.in +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/README.md +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/docs/Makefile +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/docs/_static/README.md +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/docs/_static/custom.css +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/docs/api.rst +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/docs/conf.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/docs/index.rst +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/docs/intro.rst +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/docs/make.bat +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/setup.cfg +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/python_socketio.egg-info/dependency_links.txt +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/python_socketio.egg-info/not-zip-safe +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/python_socketio.egg-info/top_level.txt +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/__init__.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/asgi.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/async_admin.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/async_aiopika_manager.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/async_redis_manager.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/async_simple_client.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/exceptions.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/middleware.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/msgpack_packet.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/simple_client.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/src/socketio/tornado.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/__init__.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/async/__init__.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/asyncio_web_server.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/common/__init__.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/performance/README.md +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/performance/binary_packet.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/performance/json_packet.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/performance/namespace_packet.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/performance/run.sh +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/performance/server_receive.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/performance/server_send.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/performance/server_send_broadcast.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/performance/text_packet.py +0 -0
- {python_socketio-5.11.3 → python_socketio-5.12.0}/tests/web_server.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-socketio
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.12.0
|
|
4
4
|
Summary: Socket.IO server and client for Python
|
|
5
5
|
Author-email: Miguel Grinberg <miguel.grinberg@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/miguelgrinberg/python-socketio
|
|
@@ -14,7 +14,7 @@ Requires-Python: >=3.8
|
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
License-File: LICENSE
|
|
16
16
|
Requires-Dist: bidict>=0.21.0
|
|
17
|
-
Requires-Dist: python-engineio>=4.
|
|
17
|
+
Requires-Dist: python-engineio>=4.11.0
|
|
18
18
|
Provides-Extra: client
|
|
19
19
|
Requires-Dist: requests>=2.21.0; extra == "client"
|
|
20
20
|
Requires-Dist: websocket-client>=0.54.0; extra == "client"
|
|
@@ -312,8 +312,8 @@ server::
|
|
|
312
312
|
print("The connection failed!")
|
|
313
313
|
|
|
314
314
|
@sio.event
|
|
315
|
-
def disconnect():
|
|
316
|
-
print("I'm disconnected!")
|
|
315
|
+
def disconnect(reason):
|
|
316
|
+
print("I'm disconnected! reason:", reason)
|
|
317
317
|
|
|
318
318
|
The ``connect_error`` handler is invoked when a connection attempt fails. If
|
|
319
319
|
the server provides arguments, these are passed on to the handler. The server
|
|
@@ -325,7 +325,20 @@ server initiated disconnects, or accidental disconnects, for example due to
|
|
|
325
325
|
networking failures. In the case of an accidental disconnection, the client is
|
|
326
326
|
going to attempt to reconnect immediately after invoking the disconnect
|
|
327
327
|
handler. As soon as the connection is re-established the connect handler will
|
|
328
|
-
be invoked once again.
|
|
328
|
+
be invoked once again. The handler receives a ``reason`` argument which
|
|
329
|
+
provides the cause of the disconnection::
|
|
330
|
+
|
|
331
|
+
@sio.event
|
|
332
|
+
def disconnect(reason):
|
|
333
|
+
if reason == sio.reason.CLIENT_DISCONNECT:
|
|
334
|
+
print('the client disconnected')
|
|
335
|
+
elif reason == sio.reason.SERVER_DISCONNECT:
|
|
336
|
+
print('the server disconnected the client')
|
|
337
|
+
else:
|
|
338
|
+
print('disconnect reason:', reason)
|
|
339
|
+
|
|
340
|
+
See the The :attr:`socketio.Client.reason` attribute for a list of possible
|
|
341
|
+
disconnection reasons.
|
|
329
342
|
|
|
330
343
|
The ``connect``, ``connect_error`` and ``disconnect`` events have to be
|
|
331
344
|
defined explicitly and are not invoked on a catch-all event handler.
|
|
@@ -509,7 +522,7 @@ that belong to a namespace can be created as methods of a subclass of
|
|
|
509
522
|
def on_connect(self):
|
|
510
523
|
pass
|
|
511
524
|
|
|
512
|
-
def on_disconnect(self):
|
|
525
|
+
def on_disconnect(self, reason):
|
|
513
526
|
pass
|
|
514
527
|
|
|
515
528
|
def on_my_event(self, data):
|
|
@@ -525,7 +538,7 @@ coroutines if desired::
|
|
|
525
538
|
def on_connect(self):
|
|
526
539
|
pass
|
|
527
540
|
|
|
528
|
-
def on_disconnect(self):
|
|
541
|
+
def on_disconnect(self, reason):
|
|
529
542
|
pass
|
|
530
543
|
|
|
531
544
|
async def on_my_event(self, data):
|