python - Associate role to a Crossbar component -
i run component
role. each time set "role" argument component crossbar server runs there infinite loop in : first time on page, work if refresh or open window same page or if client open page, page loading on , over...
then if stop crossbar server have message multiple times in logs : [controller 4422] waiting 4433 exit...
here conf.json:
{ "controller": { }, "workers": [ { "type": "router", "options": { "pythonpath": [".."] }, "realms": [ { "name": "realm1", "roles": [ { "name": "anonymous", "permissions": [ { "uri": "*", "publish": true, "subscribe": true, "call": true, "register": false } ] }, { "name": "wamp_app", "permissions": [ { "uri": "*", "publish": true, "subscribe": true, "call": true, "register": true } ] } ] } ], "transports": [ { "type": "web", "endpoint":{ "type":"tcp", "port":8000 }, "paths": { "/": { "type": "wsgi", "module": "cyto_multihead.wsgi", "object": "application" }, "lp": { "type": "longpoll" }, "static": { "type": "static", "directory": "../static/" }, "ws": { "type": "websocket" } } } ], "components": [ { "type": "class", "classname": "crossbar_test.crossbar.mycomponent", "realm": "realm1", "role": "wamp_app" } ] } ] }
my files placed this:
my_project_directory/ .crossbar/ config.json crossbar_test/ crossbar.py
moreover, if don't specify role, server doesn't start error:
[router 28146] --- <exception caught here> --- [router 28146] file "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 150, in maybedeferred [router 28146] result = f(*args, **kw) [router 28146] file "/usr/local/lib/python2.7/dist-packages/crossbar/worker/router.py", line 510, in start_router_component [router 28146] self.session_factory.add(session, authrole=config.get('role', 'anonymous')) [router 28146] file "/usr/local/lib/python2.7/dist-packages/crossbar/router/session.py", line 470, in add [router 28146] self._app_sessions[session] = routerapplicationsession(session, self._routerfactory, authid, authrole) [router 28146] file "/usr/local/lib/python2.7/dist-packages/crossbar/router/session.py", line 88, in __init__ [router 28146] assert(authrole none or isinstance(authrole, six.text_type)) [router 28146] exceptions.assertionerror: [router 28146] 'failure while invoking procedure <bound method routerworkersession.start_router_component of <crossbar.worker.router.routerworkersession object @ 0x7fc1a4484cd0>> registered under "crossbar.node.conan.worker.worker1.start_router_component".' [controller 28135] traceback (most recent call last): [controller 28135] file "/usr/local/lib/python2.7/dist-packages/crossbar/controller/node.py", line 183, in run_node_config [controller 28135] yield self._run_node_config(config) [controller 28135] applicationerror: applicationerror('wamp.error.runtime_error', args = (), kwargs = {}) [controller 28135] sending term subprocess 28146 [controller 28135] waiting 28146 exit... [router 28146] received sigterm, shutting down. [router 28146] connection node controller lost. [router 28146] main loop terminated. [controller 28135] worker 28146: process connection gone (connection closed cleanly.) [controller 28135] main loop terminated.
what wrong in config ?
i think problem comes configuration below:
"/": { "type": "wsgi", "module": "cyto_multihead.wsgi", "object": "application" },
if change configuration, example:
"/": { "type": "static", "directory": "../hello/web" },
crossbar run successfully.
Comments
Post a Comment