So I'm expanding my use of the scheduler -- one of the best features of 
web2py -- and I'm running into a "scaling" problem.

I'm going to have perhaps a hundred little functions that the scheduler 
inserts into the queue.  Now, if I define my little functions in the same 
Model page as the scheduler, everything works as expected.  Each of my 
functions is like a stub -- it generally provides a call point for the 
scheduler but then accesses code in a module somewhere.  Although each 
function is kept as small as possible, I'm still loading a large number of 
little functions with every web page access, activity I would like to avoid.

There is a dictionary I can pass to the scheduler which names each of the 
functions to be used as entries, but then I have to create a dictionary 
with a large number of entries, each time a web page is called.  Again, 
activity I'd rather avoid in the 99.9999% of web page accesses that don't 
need or use the scheduler.  Plus I'm not sure I can create the dictionary 
if its functions are scattered across controllers.  That would seem 
unlikely to compile since only one controller is visible at any one pass 
through the model.

What is this dictionary for, and how can I avoid needing it at all?  There 
are only a few comments in the book regarding this topic.  Mostly a warning 
that the "workers must be restarted" if the dictionary changes.  (Has 
anyone noticed that stopping or restarting the workers is never described? 
 I presume this is a console process which makes it outsides the bounds of 
what I'm looking for.)

No matter what I try, unless the function is defined in the same model page 
as the scheduler, all I get from the scheduler is "NameError: name 'xxxxx' 
not found in scheduler's environment" even though I specifically test to 
make sure it is visible when invoking web2py -M -S app/controller/xxxxx

How do I scale this up without needing 100 stub functions in a model file 
along with the scheduler?

-- Joe

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.

Reply via email to