Hi all,I'm quite new to cherrypy, I've been playing around with it over the last few weeks and enjoying the simple and minimal approach taken with the framework. Ive been using it for a small project of mine, which is primarily for running a turn based strategy game engine, and an AI for playing that game.I've run into a problem that Im having trouble investigating further. I'm basically just getting a 'Bus error' message in my console output, and everything dies at that point. The code that runs to produce the failure is a recursive method, and obviously thats not ideal to be running during a request. But my profiling and tracing suggests its only being called ~100 times before cherrypy falls over, and its only to a max depth of 2.
So ive got a couple of questions that can help me deal with the issue. First of all, I was looking for a nice example of async request handling. The best hints so far are either the BackgroundTask or Monitor documented at http://docs.cherrypy.org/stable/refman/process/plugins/index.html#monitors (i'd really like to see an example to get my head around how to use these), or the wiki article http://tools.cherrypy.org/wiki/BackgroundTaskQueue. Is this how I should proceed to shift the load of my game AI out of a straight synchronous request handler?
Hey Eddie, just as an alternative to celery I thought I'd offer up lamegame_tasking (on github.com/wwoods).
Benefits over celery (up to you if you need them):
1. It was designed for complicated architectures like games -
A. support for task priorities
B. scheduling events in the future
C. keeping a type of task running constantly while a user is logged in but letting it die off (saving you resources) when they're not
D. Tasks with the ability to talk to each other without going through a database (again saves resources)
E. Scheduled tasks
2. Has a status monitor that uses cherrypy
Downsides:
1. Less mature
2. Forced to use mongodb (I've been doing some speed tests recently, and this may be an upside ...)
Anyway, if you're interested let me know. The docs are a tiny bit out of date sadly, but I'm still working on it and it has worked phenomenally forsho me so far.
-Walt
--
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to cherryp...@googlegroups.com.
To unsubscribe from this group, send email to cherrypy-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en.
My recursion was blowing past the default stack size settings of python. Using threading.stack_size and sys.setrecursionlimit, I can get my app to run for longer, but its all just pointing to the fact that I need to rethink my basic use of recursion here. I'm going to have a play with stackless python, it seems to offer a bunch of advantages for what Im trying to do, including more efficient use of the stack (from what I've read so far).