(I am not sure what the term is for the web2py "dispatch queue") Every 10 seconds my webpage is performing a JSNORPC request. Inspecting the network with ngrep shows exactly that: one request every 10 seconds.
This is the service being requested (in applications/portlet/controllers/default.py) @service.jsonrpc def get_cdr_page(pars_json): get_module_log().info("pars_json='%s' now=%s" % (pars_json, request.now)) return [] But my logfile is showing a very strange situtation: 2012-06-24 19:34:19,464 - Thread-3 - __restricted__ - INFO - pars_json='{"page":0}' now=2012-06-24 19:34:19.352900 2012-06-24 19:34:29,361 - Thread-4 - __restricted__ - INFO - pars_json='{"page":0}' now=2012-06-24 19:34:29.354196 2012-06-24 19:34:29,361 - Thread-4 - __restricted__ - INFO - pars_json='{"page":0}' now=2012-06-24 19:34:29.354196 2012-06-24 19:34:39,362 - Thread-5 - __restricted__ - INFO - pars_json='{"page":0}' now=2012-06-24 19:34:39.355891 2012-06-24 19:34:39,362 - Thread-5 - __restricted__ - INFO - pars_json='{"page":0}' now=2012-06-24 19:34:39.355891 2012-06-24 19:34:39,362 - Thread-5 - __restricted__ - INFO - pars_json='{"page":0}' now=2012-06-24 19:34:39.355891 2012-06-24 19:34:49,364 - Thread-6 - __restricted__ - INFO - pars_json='{"page":0}' now=2012-06-24 19:34:49.357771 2012-06-24 19:34:49,364 - Thread-6 - __restricted__ - INFO - pars_json='{"page":0}' now=2012-06-24 19:34:49.357771 2012-06-24 19:34:49,364 - Thread-6 - __restricted__ - INFO - pars_json='{"page":0}' now=2012-06-24 19:34:49.357771 2012-06-24 19:34:49,364 - Thread-6 - __restricted__ - INFO - pars_json='{"page":0}' now=2012-06-24 19:34:49.357771 As I understand this log, web2py is creating a different thread each time that a request is received. This is as expected. What I do not understand, is that it seems that the code in my JSONRPC function seems to be executed multiple times for each request. Specifically, the first request executes the code once, the second request (10 seconds later) exectues the code twice, the thirds request (again 10 seconds later) executes the code three times, and so on. I am completely puzzled. What does this mean? Thanks, Daniel --