panther 4.2.1__py3-none-any.whl → 4.2.2__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.
panther/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  from panther.main import Panther # noqa: F401
2
2
 
3
- __version__ = '4.2.1'
3
+ __version__ = '4.2.2'
4
4
 
5
5
 
6
6
  def version():
panther/base_websocket.py CHANGED
@@ -1,12 +1,11 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import asyncio
4
- import logging
4
+ import orjson as json
5
5
  from multiprocessing.managers import SyncManager
6
6
  from typing import TYPE_CHECKING, Literal
7
7
 
8
- import orjson as json
9
-
8
+ import logging
10
9
  from panther import status
11
10
  from panther.base_request import BaseRequest
12
11
  from panther.configs import config
@@ -53,9 +52,14 @@ class WebsocketConnections(Singleton):
53
52
  logger.info("Subscribed to 'websocket_connections' queue")
54
53
  while True:
55
54
  try:
56
- received_message = queue.get()
55
+ received_message = await asyncio.to_thread(queue.get)
56
+ if received_message is None:
57
+ # The None came from the CancelledError, so break the loop
58
+ break
57
59
  await self._handle_received_message(received_message=received_message)
58
- except InterruptedError:
60
+ except (InterruptedError, asyncio.CancelledError):
61
+ # Put the None to the queue, so the executor knows that it ends
62
+ queue.put(None)
59
63
  break
60
64
  else:
61
65
  # We have a redis connection, so use it for pubsub
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: panther
3
- Version: 4.2.1
3
+ Version: 4.2.2
4
4
  Summary: Fast & Friendly, Web Framework For Building Async APIs
5
5
  Home-page: https://github.com/alirn76/panther
6
6
  Author: Ali RajabNezhad
@@ -1,11 +1,11 @@
1
- panther/__init__.py,sha256=FNvVOK_b7dQt56wvvO6McE7Wsf-S0hrE5BYEyXdaMvI,110
1
+ panther/__init__.py,sha256=Sv6vixQQrNOJFV4kgGUL-pMtNbXp7MrXCoCs7BYP6p0,110
2
2
  panther/_load_configs.py,sha256=AVkoixkUFkBQiTmrLrwCmg0eiPW2U_Uw2EGNEGQRfnI,9281
3
3
  panther/_utils.py,sha256=j0rwIxTf0rtcZAAD-1nGE-_bWpvinyKtnwt3uO0hMmY,4330
4
4
  panther/app.py,sha256=e2eb4sXIaBje5vpcm4pbvvEO_sj83pLfBHCIZJFFX38,8222
5
5
  panther/authentications.py,sha256=gf7BVyQ8vXKhiumJAtD0aAK7uIHWx_snbOKYAKrYuVw,5677
6
6
  panther/background_tasks.py,sha256=HBYubDIiO_673cl_5fqCUP9zzimzRgRkDSkag9Msnbs,7656
7
7
  panther/base_request.py,sha256=XD2v1gLWcCKHePowRxT6_fYnS4tdKFxTLINMX0HQu8M,3880
8
- panther/base_websocket.py,sha256=iJUIbrfnh3ZLXlmKxTswMw158eNvtBFi8RZ-aBBmc8w,10643
8
+ panther/base_websocket.py,sha256=L0tiQQjg7E3462cd91PMf_SoVMMK4YiwW45yTFdTLhY,10973
9
9
  panther/caching.py,sha256=ltuJYdjNiAaKIs3jpO5EBpL8Y6CF1vAIQqh8J_Np10g,4098
10
10
  panther/configs.py,sha256=EaLApT6nYcguBoNXBG_8n6DU6HTNxsulI2943j8UAkE,3174
11
11
  panther/events.py,sha256=bxDqrfiNNBlvD03vEk2LDK4xbMzTMFVcgAjx2ein7mI,1158
@@ -49,9 +49,9 @@ panther/panel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
49
  panther/panel/apis.py,sha256=COsbwKZyTgyHvHYbpDfusifAH9ojMS3z1KhZCt9M-Ms,2428
50
50
  panther/panel/urls.py,sha256=JiV-H4dWE-m_bfaTTVxzOxTvJmOWhyLOvcbM7xU3Bn4,240
51
51
  panther/panel/utils.py,sha256=0Rv79oR5IEqalqwpRKQHMn1p5duVY5mxMqDKiA5mWx4,437
52
- panther-4.2.1.dist-info/LICENSE,sha256=2aF1hL2aC0zRPjzUkSxJUzZbn2_uLoOkn7DHjzZni-I,1524
53
- panther-4.2.1.dist-info/METADATA,sha256=wCJaRg5G5kpp0tdMp6z1HXIY9QLMVuDmcqFpmee9ksY,6376
54
- panther-4.2.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
55
- panther-4.2.1.dist-info/entry_points.txt,sha256=6GPxYFGuzVfNB4YpHFJvYex6iWah5_tLnirAHwj2Qsg,51
56
- panther-4.2.1.dist-info/top_level.txt,sha256=VbBs02JGXTIoHMzsX-eLOk2MCbBZzQbLhWiYpI7xI2g,8
57
- panther-4.2.1.dist-info/RECORD,,
52
+ panther-4.2.2.dist-info/LICENSE,sha256=2aF1hL2aC0zRPjzUkSxJUzZbn2_uLoOkn7DHjzZni-I,1524
53
+ panther-4.2.2.dist-info/METADATA,sha256=WuUnOJAvGmczG9Mq0UJu0dKjaFLDqL6Vqvvh0cceGD0,6376
54
+ panther-4.2.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
55
+ panther-4.2.2.dist-info/entry_points.txt,sha256=6GPxYFGuzVfNB4YpHFJvYex6iWah5_tLnirAHwj2Qsg,51
56
+ panther-4.2.2.dist-info/top_level.txt,sha256=VbBs02JGXTIoHMzsX-eLOk2MCbBZzQbLhWiYpI7xI2g,8
57
+ panther-4.2.2.dist-info/RECORD,,