
Am 18.06.24 um 18:36 schrieb meejah:
On Thu, 30 May 2024, at 17:05, Glyph wrote:
We should resurrect the effort to build a first-party websockets implementation: <https://github.com/twisted/twisted/issues/4173 <https://github.com/twisted/twisted/issues/4173>>. It's been nice to have Autobahn available, but websockets are by far the quickest and easiest way to provide a /native/ demonstration of Twisted's
how is "native" defined? as in, part of and installed as Twisted package? why is that desirable? why wouldn't I care about "other stuff" that is _also_ install apart from Twisted? like eg a Posix kernel, or a Python run-time?
capabilities. Luckily, we do not have to build an implementation ourselves, as a maintained sans-io kernel implementation exists in the <https://github.com/python-hyper/wsproto <https://github.com/python-hyper/wsproto>> project. So we just need to do a direct integration with the Resource model in twisted.web. I will probably do some work on this project myself.
fwiw, Autobahn was built "sans-IO" pretty much from the beginning, simply as a necessity of targeting _both_ Twisted and asyncio. but Autobahn _is_ not zero-sans, but _contains_ a zero-sans websocket implementation this can be seen from the absence of both Twisted and asyncio imports, only txaio imports here https://github.com/crossbario/autobahn-python/blob/f38f16ba28fa253dee951068c... the reason for txaio is: Autobahn not _only_ provides a zero-sans WebSocket implementation, but also respective network layer bindings (to Twisted and asyncio), and to aggregate/factorize that code, there is txaio Autobahn is also a complete (eg it has facilities for WebSocket standard extensions, including deflate) and compliant WebSocket implementation, both extensively tested using Autobahn Testsuite, which was the first and still is the most complete WebSocket implementation testsuite Autobahn also is proven real-world, and using both Twisted and asyncio, and over various transports, including stuff like Unix domain sockets or stdio or serial .. Finally, Autobahn _also_ includes not only WebSocket, but WAMP as well - integrated with WebSocket as one transport ..
Hello,
I don't want to tell excited developers to _not_ do a thing, but to me this seems a little weird since Autobahn already does all of this (including "a direct integration with the Resource model in twisted.web"). And has a done a _ton_ of work to ensure strict RFC compliance and high performance.
Yes, exactly, a _ton_ of work .. like writing a testsuite in the first place and fixing/nagging upstream bugs .. from low-level (UTF8) to high level ... testing in various real-world settings
I'm 98% sure that PRs to improve any aspects of the Autobahn implementation would be accepted (by that project). Although IIRC it
"improve", yes, sure! "any": that depends. what is wrong with it anyways? rgd WebSocket standard compliance, I would say it is as good as it gets.
wasn't written with exact "Sans-IO" guidance in mind [1], the
I would say we did it without knowing there would be a name for it later on;)
implementation is already 'fairly' separated since it supports both
it is perfectly separated (see above), including proper internal APIs for zero-sans https://github.com/crossbario/autobahn-python/blob/f38f16ba28fa253dee951068c...
asyncio and Twisted (your choice) out of the box.
It has been a few years while since I've directly worked on Autobahn / Crossbar but I'd be happy to pair with anyone excited about this to pass on what I do know and where things are located.
I guess what I'm saying is that maybe modifying the proposed project slightly to become "integrate Hyper's state machine into Autobahn" makes a lot more sense. Assuming they handle that vast array of edge cases and
I don't see a need to integrate another state machine, can you point me to a bug? otherwise, what's the upside?
weirdness that is WebSockets ;) ...or perhaps I misunderstand what "demonstrate Twisted's native capabilities" actually means in this context.
same here, what is "native" supposed to mean in this context? code shipped as part of Twisted? and if so, why? why ship the world as part of Twisted?
[1] I don't think e.g. a "threaded" / blocking backend would work well in the current implementation, but adding an AnyIO or curio one should be (relatively) straightforward.
fwiw, rgd Autobahn, the one transport which is missing and I am interested in is: VirtIO VirtIO would allow zero-copy, not only single-copy - which is already available in Posix via UDS. "AnyIO or curio": these are just wrappers around classic Posix sockets, right? I mean, Autobahn on Linux should and is using epoll already, so what exactly is wrong with that?
-- meejah
_______________________________________________ Twisted mailing list -- twisted@python.org To unsubscribe send an email to twisted-leave@python.org https://mail.python.org/mailman3/lists/twisted.python.org/ Message archived at https://mail.python.org/archives/list/twisted@python.org/message/MILGHPJ4ECJ... Code of Conduct: https://twisted.org/conduct