sorry for late reply ..
I am looking how to write a native worker worker?
You can't. Native workers (router and container workers are an implementation detail of Crossbar.io).
As in article its stated:
1) How to write this special process container in twisted python. Any
example here which can run at crossbar, or its any WAMP python code
(application runner) which connects to crossbar. As I believe internal
workers communicate with internal IPC on Unix socket, but wamp
application component is over a transport and connect over web/tcp socket
It works like this:
(1) A WAMP component that you have written in Python using AutobahnPython/Twisted can be deployed in more variants than
(2) a WAMP component written in some other WAMP supported language.
(1) can be run in Crossbar.io
a) embedded in a router worker - it will then talk to the router over a pseudo-transport which simply boils down to function calls
b) in a container worker - it then can talk over any transport support by Crossbar.io (Unix domain sockets is just one)
c) in a regular guest worker - again it can talk over any transport
With a) and b), you can have multiple such components running in the same process/worker. Not with c) - there is only one component (since WAMP currently does not support multiplexed transports).
2) Here I am looking at the block diagram and trying to understand how
should I write some native python code which can do some processing at
crossbar router (not at the client), and it seems to me that
architecture supports it, like u have templates and static webserver
No, you can't. A component like (1) above can be _deployed_ in more variants (see above), but it can't _do_ anything more than any other WAMP component.
In particular, you cannot modify or directly call into the router internals.
This is by design: router code and app code MUST NOT be mixed.
3) So I need help in writing such middleware at the crossbar running
machine itself (say a server) using the native container worker
You can open a listening port in any WAMP component as you like.
Hope this helps,
Am 25.09.2015 um 17:53 schrieb Priyank Kumar:
From the documentation:
Crossbar.io can work as a component host or component container for WAMP
application components - regardless in which language they are written
or under which run-time they run. You can host mixed language or
run-time application component sets.
Native Python application components are hosted in special worker
processes called /Containers/.
On Friday, September 25, 2015 at 3:54:18 AM UTC-7, Alexander Gödde wrote:
I'm not sure I understand your question fully.
Native workers are Python/Twisted code which is started based on the
Crossbar.io node configuration. There is no dynamic spawning of
these at present - and any such spawning will, in the future, be via
the management API, not via any triggers within Crossbar.io itself.
The "custom host application" and not wanting a WAMP application
component seems to suggest you want something which forms a direct
part of the node controller. Workers, whether native or containers,
communicate with the node controller using WAMP, and we do not
provide any other way - or think that such an other way is required.
BTW, your example of publishing the CPU usage is something that the
upcoming management API will cover.
Am Freitag, 25. September 2015 00:56:34 UTC+2 schrieb Priyank Kumar:
I went through the architecture
<http://crossbar.io/docs/Architecture/> . Its amazing how
twisted is getting used and I am in love with it.
One interesting thing is we can write a native worker under
crossbar instance which would be controlled by node controller.
Is there an illustration how to write a simple native worker
which starts as crossbar starts. Say I want to start publishing
my CPU usage as soon as crossbar starts and I dont want to run
separate wamp python code for that ?
I cant find any documentation or API on how to proceed on it,
one thing I know is if I write my code in Python using WAMP
applicaiton component, I can hook to the crossbar, but I am not
looking for this.
What I am looking for is having custom host application as part
of native worker coded in twisted which can be dynamically
spawned by crossbar controller based on some rules. I am sure
this can be achieved based on architecture diagram.
You received this message because you are subscribed to the Google
Groups "Crossbar" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to crossbario+...@googlegroups.com
To post to this group, send email to cross...@googlegroups.com
To view this discussion on the web visit
For more options, visit https://groups.google.com/d/optout.