Autobahn WAMP-RPC server without Twisted

#1

Is it possible to implement a WAMP-RPC server without the Twisted framework?
If yes - is there any small example?

If no - are the minimal dependencies of Twisted modules documented anywhere?

Many thanks,

Matthias

0 Likes

#2

I forgot to clarify that I want to leverage Autobahn.Python.

Thanks for any advice,

Matthias

···

Am Mittwoch, 16. Juli 2014 17:33:33 UTC+2 schrieb Matthias K.:

Is it possible to implement a WAMP-RPC server without the Twisted framework?
If yes - is there any small example?

If no - are the minimal dependencies of Twisted modules documented anywhere?

Many thanks,

Matthias

0 Likes

#3

Matthias,

Is it possible to implement a WAMP-RPC server without the Twisted framework?

Not sure what "WAMP-RPC server" refers to here.

There are WAMP _application components_ (class ApplicationSession).

You can write those on Twisted or asyncio. Both are supported.

E.g. for the latter, have a look at the examples below this folder

https://github.com/tavendo/AutobahnPython/tree/master/examples/asyncio/wamp/basic

like this one

https://github.com/tavendo/AutobahnPython/blob/master/examples/asyncio/wamp/basic/rpc/arguments/frontend.py

This is where application code resides.

Now, to run a WAMP system, you need a WAMP _router_ - a generic piece that does not contain application code.

You can use a full featured, packaged router like Crossbar.io. In this case, all you need is to connect your app component to the router as a client. Here is an example:

https://github.com/tavendo/AutobahnPython/blob/master/examples/asyncio/wamp/beginner/client.py

Or you can roll your own router using AutobahnPython and the building blocks included there. And these building blocks are also available for aswyncio, e.g.

https://github.com/tavendo/AutobahnPython/blob/master/examples/asyncio/wamp/beginner/server.py

Hope this helps,
/Tobias

···

Am 16.07.2014 17:33, schrieb 'Matthias K.' via Autobahn:

If yes - is there any small example?
If no - are the minimal dependencies of Twisted modules documented anywhere?

Many thanks,

Matthias

--
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
<mailto:autobahnws+...@googlegroups.com>.
To post to this group, send email to autob...@googlegroups.com
<mailto:autob...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/autobahnws/aedbee3c-461f-4050-83f0-3b9e9dee315c%40googlegroups.com
<https://groups.google.com/d/msgid/autobahnws/aedbee3c-461f-4050-83f0-3b9e9dee315c%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

0 Likes

#4

Hello Tobias,

Vielen Dank für Ihre Antwort.

Perhaps something more about my motivation:

We have a desktop application built on Python and .NET.

This application can spawn multiple processes - browser based presentations among them.

To establish interprocess communication I want to leverage Autobahn WAMP-RPC technology.

Since it is an application we distribute I would prefer a server implemented in Python.

Twisted would considerably increase the size of the installation package so I would like to avoid it.

In your example from https://github.com/tavendo/AutobahnPython/blob/master/examples/asyncio/wamp/beginner/server.py

Broker from autobahn.wamp.broker is imported.

broker.py does contain line 21: from twisted.internet.defer import maybeDeferred

Is there anything I can do to avoid this import?

Thanks again for any hint,

Matthias

0 Likes

#5

Hello Tobias,

Vielen Dank für Ihre Antwort.

Perhaps something more about my motivation:
We have a desktop application built on Python and .NET.
This application can spawn multiple processes - browser based
presentations among them.
To establish interprocess communication I want to leverage Autobahn
WAMP-RPC technology.
Since it is an application we distribute I would prefer a server
implemented in Python.
Twisted would considerably increase the size of the installation package
so I would like to avoid it.

So you want to embed the router within the application that you distribute?

And the router only connects application components running locally?

In your example from
https://github.com/tavendo/AutobahnPython/blob/master/examples/asyncio/wamp/beginner/server.py
<https://github.com/tavendo/AutobahnPython/blob/master/examples/asyncio/wamp/beginner/server.py>

Broker from autobahn.wamp.broker is imported.
broker.py does contain line 21: from twisted.internet.defer import
maybeDeferred
Is there anything I can do to avoid this import?

Yes, please file an issue;)

It seems this regression was introduced with the latest release (0.8.11). Should work with 0.8.10.

We need to use network framework specific mixins there.

/Tobias

···

Am 17.07.2014 16:11, schrieb 'Matthias K.' via Autobahn:

Thanks again for any hint,

Matthias

--
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
<mailto:autobahnws+...@googlegroups.com>.
To post to this group, send email to autob...@googlegroups.com
<mailto:autob...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/autobahnws/17615a40-2bdb-4925-9abb-eb72828d41e3%40googlegroups.com
<https://groups.google.com/d/msgid/autobahnws/17615a40-2bdb-4925-9abb-eb72828d41e3%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

0 Likes

#6

Hello Tobias,

Yes, I want to embed the router but the application components don’t have to necessarily run locally.

With version 0.8.10 the “beginner” example runs fine - WAMP ant its implemetation is really cool and useful stuff.

Especially when you consider HTML/JS components.

Some hints:

import trollius as asyncio prevents from asyncio.x import y

For trollius you have to replace yield from … with yield trollius.From(…)

Thanks again for your help (and the software …)

Matthias

0 Likes