Code Monkey home page Code Monkey logo

Comments (5)

orweis avatar orweis commented on July 30, 2024 1

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.

mrchoke avatar mrchoke commented on July 30, 2024

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.

mrchoke avatar mrchoke commented on July 30, 2024

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.

orweis avatar orweis commented on July 30, 2024

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.

orweis avatar orweis commented on July 30, 2024

Closed by #50

from fastapi_websocket_pubsub.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.