exaloop / codon

A high-performance, zero-overhead, extensible Python compiler using LLVM
https://docs.exaloop.io/codon
Other
13.97k stars 498 forks source link

Websocket library compilable by codon #200

Open L1nkus opened 1 year ago

L1nkus commented 1 year ago

Hi,

I'm looking to use codon for improving performance of high-rate websocket payload processing. I'm wondering, is there any websocket implementation working in codon? I think requests isn't part of stdlib, so I guess network stuff isn't well supported yet?

arshajii commented 1 year ago

We don't have it in the standard library yet, but I believe one user actually implemented this and posted the code in the Slack (not sure of their GitHub username, but they are @nt_tnt on Slack). Maybe you can adapt this for your use case?

Here is a Gist with the code for convenience (note that there are 3 files there, indicated with comments).

f0cii commented 8 months ago

I saw your question about WebSocket support in Codon. Coincidentally, I have recently implemented a WebSocket module for my own project. I have published the code at the following link:

websocket.py

It is still a work in progress, but it provides basic functionality for WebSocket connections and message handling. Please feel free to check it out and adapt it for your use case if it's helpful. I'm also happy to answer any questions you may have about my implementation.