Comments (5)
Hi :)
The changes needed are actually in the underlying RPC library.
I've opened a PR there, will merge after a review.
CC: @asafc
from fastapi_websocket_pubsub.
Hi :)
The changes needed are actually in the underlying RPC library. I've opened a PR there, will merge after a review.
Thank you for your response.
CC: @asafc
I try to run pytest on fastapi_websocket_pubsub after patch fastapi_websocket_rpc it not pass tests/broadcaster_test.py .
DEBUG websockets.client:protocol.py:256 = connection is CONNECTING
DEBUG websockets.client:client.py:114 > GET /ws1 HTTP/1.1
DEBUG websockets.client:client.py:116 > Host: localhost:7990
DEBUG websockets.client:client.py:116 > Upgrade: websocket
DEBUG websockets.client:client.py:116 > Connection: Upgrade
DEBUG websockets.client:client.py:116 > Sec-WebSocket-Key: vH4jO8icQ+96dnZFBBolig==
DEBUG websockets.client:client.py:116 > Sec-WebSocket-Version: 13
DEBUG websockets.client:client.py:116 > Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
DEBUG websockets.client:client.py:116 > User-Agent: Python/3.11 websockets/10.4
DEBUG websockets.client:client.py:147 < HTTP/1.1 500 Internal Server Error
DEBUG websockets.client:client.py:149 < content-type: text/plain; charset=utf-8
DEBUG websockets.client:client.py:149 < content-length: 21
DEBUG websockets.client:client.py:149 < connection: close
DEBUG websockets.client:protocol.py:1429 ! failing connection with code 1006
DEBUG websockets.client:protocol.py:1334 x half-closing TCP connection
DEBUG websockets.client:protocol.py:1514 = connection is CLOSED
it has 500 Internal Server Error
from fastapi_websocket_pubsub.
fastapi error log
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/Users/mrchoke/Work/python/fastapi_websocket_pubsub/venv/lib/python3.11/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 238, in run_asgi
result = await self.app(self.scope, self.asgi_receive, self.asgi_send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mrchoke/Work/python/fastapi_websocket_pubsub/venv/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mrchoke/Work/python/fastapi_websocket_pubsub/venv/lib/python3.11/site-packages/fastapi/applications.py", line 270, in __call__
await super().__call__(scope, receive, send)
File "/Users/mrchoke/Work/python/fastapi_websocket_pubsub/venv/lib/python3.11/site-packages/starlette/applications.py", line 124, in __call__
await self.middleware_stack(scope, receive, send)
File "/Users/mrchoke/Work/python/fastapi_websocket_pubsub/venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 149, in __call__
await self.app(scope, receive, send)
File "/Users/mrchoke/Work/python/fastapi_websocket_pubsub/venv/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
raise exc
File "/Users/mrchoke/Work/python/fastapi_websocket_pubsub/venv/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
await self.app(scope, receive, sender)
File "/Users/mrchoke/Work/python/fastapi_websocket_pubsub/venv/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
raise e
File "/Users/mrchoke/Work/python/fastapi_websocket_pubsub/venv/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
await self.app(scope, receive, send)
File "/Users/mrchoke/Work/python/fastapi_websocket_pubsub/venv/lib/python3.11/site-packages/starlette/routing.py", line 706, in __call__
await route.handle(scope, receive, send)
File "/Users/mrchoke/Work/python/fastapi_websocket_pubsub/venv/lib/python3.11/site-packages/starlette/routing.py", line 341, in handle
await self.app(scope, receive, send)
File "/Users/mrchoke/Work/python/fastapi_websocket_pubsub/venv/lib/python3.11/site-packages/starlette/routing.py", line 82, in app
await func(session)
File "/Users/mrchoke/Work/python/fastapi_websocket_pubsub/venv/lib/python3.11/site-packages/fastapi/routing.py", line 287, in app
await dependant.call(**values)
File "/Users/mrchoke/Work/python/fastapi_websocket_pubsub/tests/broadcaster_test.py", line 72, in websocket_rpc_endpoint
await endpoint.main_loop(websocket)
File "/Users/mrchoke/Work/python/fastapi_websocket_pubsub/fastapi_websocket_pubsub/pub_sub_server.py", line 137, in main_loop
done, pending = await asyncio.wait([self.endpoint.main_loop(websocket, client_id=client_id, **kwargs),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.11.0/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/tasks.py", line 415, in wait
raise TypeError("Passing coroutines is forbidden, use tasks explicitly.")
TypeError: Passing coroutines is forbidden, use tasks explicitly.
from fastapi_websocket_pubsub.
Hi @mrchoke - sorry I missed your message.
Maybe your patch didn't work as expected?
I've released the RPC as new version (0.1.24)
And dependent tests here pass successfully:
#50
Will release soon as a new version, after CR.
from fastapi_websocket_pubsub.
Closed by #50
from fastapi_websocket_pubsub.
Related Issues (17)
- too many file descriptors in select() HOT 2
- Demo: got Future <Future pending> attached to a different loop HOT 3
- starlette requirement failing HOT 3
- notifier_client_test.py seems to be missing HOT 1
- how can i get client's data on server HOT 2
- Can we use celery as PUB/SUB? HOT 2
- Private or Non-Broadcast Messages
- Do you have a JavaScript client that can connect to an instance of this running on the server? HOT 2
- Timeout Error HOT 2
- Subscribe to Channels via Javascript Client HOT 1
- Javascript Client for Frontend HOT 1
- Typo HOT 1
- Is there a detailed tutorial on "websocket"?
- How to use as just a Websocket server (for browser/mobile client)?
- Optional dependencies - Broadcaster Postgres dependency problem HOT 1
- ALL_TOPICS client subscription not working HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastapi_websocket_pubsub.