AutobahnPython 0.7.0 released

#1

Hi,

I am happy to announce the release of AutobahnPython 0.7.0

https://github.com/tavendo/AutobahnPython
https://pypi.python.org/pypi/autobahn

This release brings 4 major features:

1) Support for Python 3

Autobahn now works with Twisted running on Python 3.

Note: Not all examples work with Twisted/Python3, since Python 3 support with Twisted is work-in-progress.

2) Support for asyncio

Asyncio (http://docs.python.org/3.4/library/asyncio.html) is a new networking framework that comes built into Python 3.4, and that can be installed on Python 3.3.

Autobahn now fully (with all features) supports both Twisted (on Python 2 and 3) and asyncio (on Python 3.3+).

Here is an example that shows how to do WebSocket on both:

Twisted:
https://github.com/tavendo/AutobahnPython/tree/master/examples/twisted/websocket/echo

Asyncio:
https://github.com/tavendo/AutobahnPython/tree/master/examples/asyncio/websocket/echo

The application code is very similar or even identical.

Note: Support for 2) and 3) required major refactoring under the hood. But to upgrade existing code, it should be sufficient to replace respective imports:

Autobahn < 0.7.0:
from autobahn.websocket import WebSocketServerProtocol

Autobahn 0.7.0:
from autobahn.twisted.websocket import WebSocketServerProtocol or from autobahn.asyncio.websocket import WebSocketServerProtocol

3) full support for Twisted endpoints, a wrapping protocol/factory and a generic endpoint forwarder

https://github.com/tavendo/AutobahnPython/tree/master/examples/twisted/websocket/echo_endpoints
https://github.com/tavendo/AutobahnPython/tree/master/examples/twisted/websocket/wrapping

4) Use of Interfaces

The core Autobahn interfaces that applications are using are now properly defined using "zope.interface" machinery:

http://autobahn.ws/static/reference/python/websocketintro.html#interface-definition

The interfaces are what we are committed to keep stable up from now.

···

==

Notes:

We've been working hard to make sure everything still works as previously, but the changes in the code base are large. So please forgive if there are glitches popping up.

The upcoming WAMPv2 did not make it into this release (it's already the biggest release since a long time).
WAMPv2 will be introduced gradually over the coming weeks in point releases, and then a final 0.8 release will be rolled out which deprecates WAMPv1.

Cheers,
/Tobias

0 Likes

#2

Congrats for the release!

If I were less lazy (and probably had more time), I would also complete the port to asyncio. I have a couple of questions nonetheless:

  • You mention a lot of rework under the hood, it seems this may also be the case for ws4py when I’ll address this feature. What was the main difficulties?

  • Did you notice any performance improvments?

  • Do you plan on releasing a twisted-less version of autobahn someday? In my mind twisted is just one interface, the WebSocket protocol could be implemented in a library fashion independently from twisted itself (this is why ws4py tries hard to decouple the socket from the protocol implementation. See for instance: https://github.com/Lawouach/WebSocket-for-Python/blob/master/test/test_websocket.py)

Cheers,

···

On 2 January 2014 14:28, Tobias Oberstein tobias.o...@gmail.com wrote:

Hi,

I am happy to announce the release of AutobahnPython 0.7.0

https://github.com/tavendo/AutobahnPython

https://pypi.python.org/pypi/autobahn

This release brings 4 major features:

  1. Support for Python 3

Autobahn now works with Twisted running on Python 3.

Note: Not all examples work with Twisted/Python3, since Python 3 support with Twisted is work-in-progress.

  1. Support for asyncio

Asyncio (http://docs.python.org/3.4/library/asyncio.html) is a new networking framework that comes built into Python 3.4, and that can be installed on Python 3.3.

Autobahn now fully (with all features) supports both Twisted (on Python 2 and 3) and asyncio (on Python 3.3+).

Here is an example that shows how to do WebSocket on both:

Twisted:

https://github.com/tavendo/AutobahnPython/tree/master/examples/twisted/websocket/echo

Asyncio:

https://github.com/tavendo/AutobahnPython/tree/master/examples/asyncio/websocket/echo

The application code is very similar or even identical.

Note: Support for 2) and 3) required major refactoring under the hood. But to upgrade existing code, it should be sufficient to replace respective imports:

Autobahn < 0.7.0:

from autobahn.websocket import WebSocketServerProtocol

Autobahn 0.7.0:

from autobahn.twisted.websocket import WebSocketServerProtocol or from autobahn.asyncio.websocket import WebSocketServerProtocol

  1. full support for Twisted endpoints, a wrapping protocol/factory and a generic endpoint forwarder

https://github.com/tavendo/AutobahnPython/tree/master/examples/twisted/websocket/echo_endpoints

https://github.com/tavendo/AutobahnPython/tree/master/examples/twisted/websocket/wrapping

  1. Use of Interfaces

The core Autobahn interfaces that applications are using are now properly defined using “zope.interface” machinery:

http://autobahn.ws/static/reference/python/websocketintro.html#interface-definition

The interfaces are what we are committed to keep stable up from now.

==

Notes:

We’ve been working hard to make sure everything still works as previously, but the changes in the code base are large. So please forgive if there are glitches popping up.

The upcoming WAMPv2 did not make it into this release (it’s already the biggest release since a long time).

WAMPv2 will be introduced gradually over the coming weeks in point releases, and then a final 0.8 release will be rolled out which deprecates WAMPv1.

Cheers,

/Tobias

You received this message because you are subscribed to the Google Groups “Autobahn” group.

To unsubscribe from this group and stop receiving emails from it, send an email to autobahnws+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

0 Likes

#3

Congrats for the release!

If I were less lazy (and probably had more time), I would also complete
the port to asyncio. I have a couple of questions nonetheless:

* You mention a lot of rework under the hood, it seems this may also be
the case for ws4py when I'll address this feature. What was the main
difficulties?

Python 3: repetitive work, plus more work because of new "bytes" type.

But most of the work went into contemplating about the right way of restructuring the whole code base, factoring out the WebSocket stuff and putting all networking specific stuff into "adapter" classes:

https://github.com/tavendo/AutobahnPython/blob/master/autobahn/autobahn/asyncio/websocket.py#L44
https://github.com/tavendo/AutobahnPython/blob/master/autobahn/autobahn/twisted/websocket.py#L48

* Did you notice any performance improvments?

I did not measure yet. I need to upgrade the testsuite first etc ..

* Do you plan on releasing a twisted-less version of autobahn someday?

You can already use Autobahn 0.7.0 without any Twisted!

IOW: you can "pip install autobahn" on a plain Python 3.4 - in fact, the only dependency remaining for Autobahn now is "zope.interface".

In my mind twisted is just one interface, the WebSocket protocol could
be implemented in a library fashion independently from twisted itself
(this is why ws4py tries hard to decouple the socket from the protocol
implementation. See for instance:
https://github.com/Lawouach/WebSocket-for-Python/blob/master/test/test_websocket.py)

Yes, I also tried to make it fully transparent. In fact, if you compare

https://github.com/tavendo/AutobahnPython/blob/master/examples/twisted/websocket/echo/server.py#L23
https://github.com/tavendo/AutobahnPython/blob/master/examples/asyncio/websocket/echo/server.py#L23

the application code is _identical_, the only difference is the base class you switch for either Twisted or asyncio ..

Happy new year!
/Tobias

···

Am 02.01.2014 14:36, schrieb Sylvain Hellegouarch:

Cheers,

On 2 January 2014 14:28, Tobias Oberstein <tobias.o...@gmail.com > <mailto:tobias.o...@gmail.com>> wrote:

    Hi,

    I am happy to announce the release of AutobahnPython 0.7.0

    https://github.com/tavendo/__AutobahnPython
    <https://github.com/tavendo/AutobahnPython>
    https://pypi.python.org/pypi/__autobahn
    <https://pypi.python.org/pypi/autobahn>

    This release brings 4 major features:

    1) Support for Python 3

    Autobahn now works with Twisted running on Python 3.

    Note: Not all examples work with Twisted/Python3, since Python 3
    support with Twisted is work-in-progress.

    2) Support for asyncio

    Asyncio (http://docs.python.org/3.4/__library/asyncio.html
    <http://docs.python.org/3.4/library/asyncio.html>) is a new
    networking framework that comes built into Python 3.4, and that can
    be installed on Python 3.3.

    Autobahn now fully (with all features) supports both Twisted (on
    Python 2 and 3) and asyncio (on Python 3.3+).

    Here is an example that shows how to do WebSocket on both:

    Twisted:
    https://github.com/tavendo/__AutobahnPython/tree/master/__examples/twisted/websocket/__echo
    <https://github.com/tavendo/AutobahnPython/tree/master/examples/twisted/websocket/echo>

    Asyncio:
    https://github.com/tavendo/__AutobahnPython/tree/master/__examples/asyncio/websocket/__echo
    <https://github.com/tavendo/AutobahnPython/tree/master/examples/asyncio/websocket/echo>

    The application code is very similar or even identical.

    Note: Support for 2) and 3) required major refactoring under the
    hood. But to upgrade existing code, it should be sufficient to
    replace respective imports:

    Autobahn < 0.7.0:
    from autobahn.websocket import WebSocketServerProtocol

    Autobahn 0.7.0:
    from autobahn.twisted.websocket import WebSocketServerProtocol or
    from autobahn.asyncio.websocket import WebSocketServerProtocol

    3) full support for Twisted endpoints, a wrapping protocol/factory
    and a generic endpoint forwarder

    https://github.com/tavendo/__AutobahnPython/tree/master/__examples/twisted/websocket/__echo_endpoints
    <https://github.com/tavendo/AutobahnPython/tree/master/examples/twisted/websocket/echo_endpoints>
    https://github.com/tavendo/__AutobahnPython/tree/master/__examples/twisted/websocket/__wrapping
    <https://github.com/tavendo/AutobahnPython/tree/master/examples/twisted/websocket/wrapping>

    4) Use of Interfaces

    The core Autobahn interfaces that applications are using are now
    properly defined using "zope.interface" machinery:

    http://autobahn.ws/static/__reference/python/__websocketintro.html#interface-__definition
    <http://autobahn.ws/static/reference/python/websocketintro.html#interface-definition>

    The interfaces are what we are committed to keep stable up from now.

    ==

    Notes:

    We've been working hard to make sure everything still works as
    previously, but the changes in the code base are large. So please
    forgive if there are glitches popping up.

    The upcoming WAMPv2 did not make it into this release (it's already
    the biggest release since a long time).
    WAMPv2 will be introduced gradually over the coming weeks in point
    releases, and then a final 0.8 release will be rolled out which
    deprecates WAMPv1.

    Cheers,
    /Tobias

    --
    You received this message because you are subscribed to the Google
    Groups "Autobahn" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to autobahnws+unsubscribe@__googlegroups.com
    <mailto:autobahnws%2...@googlegroups.com>.
    For more options, visit https://groups.google.com/__groups/opt_out
    <https://groups.google.com/groups/opt_out>.

--
- Sylvain
http://www.defuze.org
http://twitter.com/lawouach

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Likes

#4

I can’t wait to play with the new release! I’ll admit, I read your announcement, but until I saw the follow up by Sylvian I completely missed this jewel:

···

On Thursday, January 2, 2014 8:01:17 AM UTC-6, Tobias Oberstein wrote:

Am 02.01.2014 14:36, schrieb Sylvain Hellegouarch:

Congrats for the release!

If I were less lazy (and probably had more time), I would also complete

the port to asyncio. I have a couple of questions nonetheless:

  • Do you plan on releasing a twisted-less version of autobahn someday?

You can already use Autobahn 0.7.0 without any Twisted!

IOW: you can “pip install autobahn” on a plain Python 3.4 - in fact, the
only dependency remaining for Autobahn now is “zope.interface”.

In my mind twisted is just one interface, the WebSocket protocol could

be implemented in a library fashion independently from twisted itself

(this is why ws4py tries hard to decouple the socket from the protocol

implementation. See for instance:

https://github.com/Lawouach/WebSocket-for-Python/blob/master/test/test_websocket.py)

Yes, I also tried to make it fully transparent. In fact, if you compare

https://github.com/tavendo/AutobahnPython/blob/master/examples/twisted/websocket/echo/server.py#L23

https://github.com/tavendo/AutobahnPython/blob/master/examples/asyncio/websocket/echo/server.py#L23

the application code is identical, the only difference is the base
class you switch for either Twisted or asyncio …

I can run autobahn with websockets without using twisted? I haven’t looked at python 3.x very seriously. I think I need to take a look!

-g

0 Likes

#5

I can run autobahn with websockets without using twisted? I haven't
looked at python 3.x very seriously. I think I need to take a look!

Yes. You can run without Twisted.

You can download Pyhton 3.4 beta .. and do "pip install autobahn".

Thats it. It won't install Twisted. If Twisted is there, Autobahn will
install it's Twisted integration. If not, then not. Same with asyncio.

Probably I should have pointed out this more clearly;)

Yes, I think 0.7.0 is a big step forward ..

/Tobias

···

-g

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Likes

#6

Congrats for the release!

If I were less lazy (and probably had more time), I would also complete
the port to asyncio. I have a couple of questions nonetheless:

* You mention a lot of rework under the hood, it seems this may also be
the case for ws4py when I'll address this feature. What was the main
difficulties?

Python 3: repetitive work, plus more work because of new "bytes" type.

Yeah it took me a while as well for ws4py and I didn't get it right first
time around.

* Do you plan on releasing a twisted-less version of autobahn someday?

You can already use Autobahn 0.7.0 without any Twisted!

IOW: you can "pip install autobahn" on a plain Python 3.4 - in fact, the
only dependency remaining for Autobahn now is "zope.interface".

That's cool. I didn't know about this. This will probably draw more people
to autobahn!

In my mind twisted is just one interface, the WebSocket protocol could

be implemented in a library fashion independently from twisted itself
(this is why ws4py tries hard to decouple the socket from the protocol
implementation. See for instance:
https://github.com/Lawouach/WebSocket-for-Python/blob/
master/test/test_websocket.py)

Yes, I also tried to make it fully transparent. In fact, if you compare

https://github.com/tavendo/AutobahnPython/blob/master/
examples/twisted/websocket/echo/server.py#L23
https://github.com/tavendo/AutobahnPython/blob/master/
examples/asyncio/websocket/echo/server.py#L23

the application code is _identical_, the only difference is the base class
you switch for either Twisted or asyncio ..

That's pretty cool. ws4py already support Tornado (client only), CherryPy,
gevent and the stdlib WSGI server. I hope it'll support asyncio easily soon
too.

Thanks again and happy new year!

···

On 2 January 2014 15:01, Tobias Oberstein <tobias.o...@gmail.com>wrote:

Am 02.01.2014 14:36, schrieb Sylvain Hellegouarch:

--
- Sylvain
http://www.defuze.org
http://twitter.com/lawouach

0 Likes