cymongoose: python bindings for mongoose using with cython. #3310
Replies: 2 comments 9 replies
-
|
The project has been renamed to |
Beta Was this translation helpful? Give feedback.
-
cymongoose v0.2.0 UpdateHi, sharing a progress update on cymongoose, the Cython wrapper for the mongoose C library. Since the initial post, the project has gone through several rounds of code review, security hardening, and test expansion. v0.2.0 marks the point where the codebase has stabilized and the core APIs are well-tested and documented. What's New Since the Original PostPerformanceThroughput has improved from 60,973 req/sec to 88,710 req/sec (wrk, 4 threads, 100 connections, on a M1 MacBook Air). This puts cymongoose at:
The gain comes from unconditional nogil on all C calls and general optimization across releases. Asyncio Integration
import asyncio
from cymongoose import AsyncManager, MG_EV_HTTP_MSG
def handler(conn, ev, data):
if ev == MG_EV_HTTP_MSG:
conn.reply(200, "Hello from async!")
async def main():
async with AsyncManager(handler) as am:
am.listen("http://0.0.0.0:8080")
await asyncio.sleep(3600)
asyncio.run(main())Features: configurable Security Hardening
Test SuiteGrew from 210 tests to 372 tests across 42 files:
Network-dependent tests (DNS, SNTP) are excluded by default and run as a separate non-blocking CI job. DocumentationFull MkDocs site at shakfu.github.io/cymongoose with:
API SummaryThe current API surface: Core classes: Message views: Manager methods:
Connection methods:
Utilities: Constants: 21 event types ( CI
Links
Feedback and bug reports welcome at https://github.com/shakfu/cymongoose/issues. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
cymongoose is a thin cython wrapper over the native mongoose C library and includes coverage of:
The wrapper is:
It has:
A Few Examples
Simple HTTP Server
Serve Static Files
WebSocket Echo Server
Beta Was this translation helpful? Give feedback.
All reactions