Skip to content

Feedback to a Reddit comment #37

@egorsmkv

Description

@egorsmkv

URL: https://www.reddit.com/r/Python/comments/1s04g42/comment/oi3lp7z/

Copy:

I tried to add rsloop to my websocket-benchmark, but couldn't make it work for any websocket library.

So, I added a very simple minimal example with websockets library (no SSL, just plain TCP):

rsloop_websockets.py

The reading seems to be broken in rsloop, websockets client can't pass the websocket negotiation phase, connect hangs up, the data is not delivered to the websockets library.

I used Python 3.14 (not freethreaded) on Linux.

I also tried TLS with my expiried self-signed certificate and quickly noticed that rsloop doesn't respect settings from SSLContext.

My settings

ssl_context.check_hostname = False
ssl_context.hostname_checks_common_name = False
ssl_context.verify_mode = ssl.CERT_NONE

But they were ignored, I got complains about certificate. Which settings from SSLContext are used and which are not? It works fine with asyncio

What does install_ssl_tracking tracking do?

I also noticed that rsloop.run() occasionally stop reacting to Ctrl+C (SIGINT) sometimes it does, sometimes it doesn't. I had to SIGKILL the process. The example seems to be trivial.

A few other random questions:

Are contextvars supported?

Why does it have to be run like rsloop.run() and not with asyncio.run?

Is it possible to first install rsloop and run main coroutine with it, then switch to a loop provided by a different library. asyncio allows it, it is very convenient for testing. Would be nice to have this.

Does rsloop monkey-patch asyncio during import rsloop?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions