AutobahnPython 0.7.3 released

#1

Hi,

AutobahnPython 0.7.3 now supports asyncio also on Python 2:

https://github.com/tavendo/AutobahnPython#python-support

Doing

pip install autobahn[asyncio]

will automatically install the required dependency:

- Trollius (an asyncio backport) on Python 2
- Tulip/asyncio on Python 3.3
- nothing on Python 3.4+

For Autobahn on Twisted:

pip install autobahn[twisted]

Cheers,
Tobias

0 Likes

#2

Hi Tobias,

I’m not so keen on trollius, it seems wrong to use raise Result(…) as a flow control. Have you tried it at all?

Cheers,

···

On 7 January 2014 13:41, Tobias Oberstein tobias.o...@gmail.com wrote:

Hi,

AutobahnPython 0.7.3 now supports asyncio also on Python 2:

https://github.com/tavendo/AutobahnPython#python-support

Doing

pip install autobahn[asyncio]

will automatically install the required dependency:

  • Trollius (an asyncio backport) on Python 2

  • Tulip/asyncio on Python 3.3

  • nothing on Python 3.4+

For Autobahn on Twisted:

pip install autobahn[twisted]

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

Hi Sylvain,

Hi Tobias,

I'm not so keen on trollius, it seems wrong to use raise Result(...) as
a flow control. Have you tried it at all?

Here are 2 examples that work on both Python 3 and 2:

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

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

I agree that the

raise asyncio.Result(..)

https://github.com/tavendo/AutobahnPython/blob/master/examples/asyncio/websocket/slowsquare/server_py2.py#L34

idiom for returning values from Trollius coroutines is somewhat strange.

I don't know about the rationale/reasons for this construct. But I am also interested. Will ask on Tulip mailing list ..

/Tobias

···

Am 07.01.2014 13:47, schrieb Sylvain Hellegouarch:

Cheers,

On 7 January 2014 13:41, Tobias Oberstein <tobias.o...@gmail.com > <mailto:tobias.o...@gmail.com>> wrote:

    Hi,

    AutobahnPython 0.7.3 now supports asyncio also on Python 2:

    https://github.com/tavendo/__AutobahnPython#python-support
    <https://github.com/tavendo/AutobahnPython#python-support>

    Doing

    pip install autobahn[asyncio]

    will automatically install the required dependency:

    - Trollius (an asyncio backport) on Python 2
    - Tulip/asyncio on Python 3.3
    - nothing on Python 3.4+

    For Autobahn on Twisted:

    pip install autobahn[twisted]

    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 agree that the

raise asyncio.Result(..)

https://github.com/tavendo/AutobahnPython/blob/master/examples/asyncio/websocket/slowsquare/server_py2.py#L34

idiom for returning values from Trollius coroutines is somewhat strange.

I've add a Twisted variant of that example that looks like this

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

0 Likes

#5

In fact, Twisted's `returnValue` does exactly the same (raise a custom exception) under the hood:

http://twistedmatrix.com/trac/browser/tags/releases/twisted-13.2.0/twisted/internet/defer.py#L1063

So one could simply define:

def returnValue(value):
    raise asyncio.Result(value)

and get the same in Trollius.

Also see this thread:

https://groups.google.com/d/msg/python-tulip/yNHO54b5vSk/5etUiVxDsI8J

explaining things (to me).

/Tobias

···

Am 07.01.2014 18:12, schrieb Tobias Oberstein:

I agree that the

raise asyncio.Result(..)

https://github.com/tavendo/AutobahnPython/blob/master/examples/asyncio/websocket/slowsquare/server_py2.py#L34

idiom for returning values from Trollius coroutines is somewhat strange.

I've add a Twisted variant of that example that looks like this

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

0 Likes