codon icon indicating copy to clipboard operation
codon copied to clipboard

Websocket library compilable by codon

Open L1nkus opened this issue 2 years ago • 2 comments

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?

L1nkus avatar Feb 23 '23 21:02 L1nkus

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).

arshajii avatar Feb 24 '23 16:02 arshajii

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.

f0cii avatar Oct 19 '23 00:10 f0cii