1) yes, the maching server is separate. the idea you want one for each 
traded product and for scalability they can be distributed on different 
servers.

2) If you only have one of a few you can use the cron scheduler @reboot and 
it will start with web2py if you use web2py.py

3) In theory yes. Yet I tried to address two issues: scalability (so the 
order queue is in ram) and reliability (what if the program crashes and 
order queue in ram gets lost?). Because of scalability I decided to 
eliminate every database IO from the matching server. For reliability 
purposes all the server IO is logged and there is another background script 
(only half backed) that is supposed to load the logs and fill in the 
database (write only). Any piece may crash and the should be possible to 
reconstruct the previous events.

On Thursday, 31 January 2013 15:53:23 UTC-6, jensk wrote:
>
> 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.pyThe
>  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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to