I am trying to get web2py set up as a WSGI server on pythonanywhere.com. 
That is really easy, but alongside a regular http server I also need 
websockets server support. Because I would like to use WAMP as protocol on 
top of websockets, I have chosen Autobahn, which uses Twisted. The server 
setup seem to be similar to the Tornado server of the EMTE example. Here is 
a script that starts up a Flash webapp and the Autobahn 
server: 
https://github.com/tavendo/AutobahnPython/blob/master/examples/websocket/echo_wsgi/server.py
 
The script loading web2py on pythonanywhere basically just says "from 
gluon.main import wsgibase as application", but it will probably stop 
working if the "reactor.run()" line from the Autobahn server does not 
return.

I have studied the EMTE example, where the matching server is implemented 
in the modules dir, but I have a few questions:

1) Modules seem to be normally used for logic code in web2py, to be 
imported/used in controllers . that's how it is explained on the slices 
site as well. But the EMTE matching server seem to be a stand alone python 
program, is this correct? It also seems that Massimo starts up the server 
manually in the Vimeo video.

2) If so, is there any way to have web2py start the matching server (or a 
similar websockets server) when web2py is started up from the WSGI script? 
Is there a method I can hook into, that is called at startup - that way I 
could start a thread that runs the WS server rather than the __main__ from 
the module. I would prefer this over running the Autobahn server from the 
WSGI script. And while we are at it, what about closedown?

3) The EMTE matching server seem to only receive/send websocket messages 
and not do any database access. Can the server just import DAL and 
read/write the database that the regular web2py server also use? Are there 
any potential thread/process concurrency issues with this if the database 
is an SQLite file, or should a client/server SQL DB be used instead?

Thanks,
Jens Kristian Jensen

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to