Aloha

now this is great news! I'm the one who dragged nevow over to Python3 with a lot of help from others and I'm still using nevow/athena for multiuser card game serving. The port of nevow was never reviewed but the code is rock stable, our servers are self hosted on FreeBSD with server uptime measured in years.

I always wanted to replace the athena long polling with websockets but didn't find the energy nor the time in the last few years. The nevow framework is of course much bigger than athena but a lot of the concepts in nevow are now firmly rooted in Twisted. This would allow peeling out the athena/LivePage part and make it into a txAthena extension.

Is there any interest from people here to work on a lightweight option for creating webapps with Twisted instead of dealing with the JavaScript server side craze?

Mahalo, Werner

On 4/13/25 15:44, gl...@twistedmatrix.com wrote:

Hello friends,

The native websockets branch that I've been puttering with is now available for review, so I'm asking for someone to review it:

https://github.com/twisted/twisted/pull/12397/files

I'm excited to get this landed and released. WebSockets are probably the most popular and common form of bidirectional asynchronous communication happening on the internet today, and it's been a bit of a weakness that we don't have a simple showcase for that in Twisted. IMAP and SSH are great to have, but they're not the _first_ thing people go looking for these days when they're looking to do something async.

We have of course had some access to the WebSockets world via Autobahn, but first-party integration will have some significant advantages:

  * _We can put a WebSockets example onto our minimal-examples
    showcase on twisted.org, because the example is similarly very
    small, and now included with no imports from other libraries._ 
    This is the major thing; a dozen or so lines of code illustrating
    how to push data from Twisted into a browser that a user can
    _immediately interact with_ is an important missing piece of the
    pitch of Twisted both as a library and as a web server.
  * There will be a much simpler onboarding experience to this
    functionality. Autobahn is still there for anyone who wants WAMP
    or XBR, but users won't be presented with those confusing concepts
    when just trying to do simple server-side push.
  * Since the gross private API internals that we rely upon are our
    own, we don't have the version-skew problems that Autobahn does
    
<https://github.com/crossbario/autobahn-python/blob/7bc85b34e200640ab98a41cfddb38267f39bc92e/autobahn/twisted/resource.py#L146-L169>,
    nor do we need overhead like anyio.
  * Since this is a much more recent implementation it also comes with
    modern niceties like coroutines rather than inlineCallbacks,
    comprehensive type annotations, and 100% code coverage.


This should also be a pretty easy layup of a review:

  * There is full code coverage and I believe full public API
    documentation coverage.
  * There's new narrative documentation
    
<https://twisted--12397.org.readthedocs.build/en/12397/web/howto/web-in-60/websockets.html>
 explaining
    how to use it.
  * The protocol implementation itself is delegated to the existing,
    minimal, sans-io wsproto library
    <https://github.com/python-hyper/wsproto> so there's not a lot of
    protocol implementation stuff to review.
  * The tests are all the new, good kind (i.e.: no native sockets, no
    real reactors), using IOPump (and improving that infrastructure a
    bit as I passed through it), with (hopefully!) no new flakiness or
    weird slowdowns.


The downside is that it _is_ brushing up against 1500 changed lines, with most of that being additions, so it is on the longer side.

Thanks in advance for volunteering,

-g

_______________________________________________
Twisted mailing list --twisted@python.org
To unsubscribe send an email totwisted-le...@python.org
https://mail.python.org/mailman3/lists/twisted.python.org/
Message archived 
athttps://mail.python.org/archives/list/twisted@python.org/message/JHHAZXS5ESQGUQEW3EOIKHPW7Q7HJL5V/
Code of Conduct:https://twisted.org/conduct
_______________________________________________
Twisted mailing list -- twisted@python.org
To unsubscribe send an email to twisted-le...@python.org
https://mail.python.org/mailman3/lists/twisted.python.org/
Message archived at 
https://mail.python.org/archives/list/twisted@python.org/message/TGSDFK2EQ3RINWKL6TN5GLBSP36WVSPT/
Code of Conduct: https://twisted.org/conduct

Reply via email to