In defence of Java, which I think is a great language/environment, my requests aren't over any particular sluggishness or dropped connections.
It is just that I have an application that when started creates a cache derived from the database and uses this to speed up selection and searching on data that is not easily index-able. It is nice to get this out of the way before the first request :-) I think your suggestion re a script is sound - I have used something similar in the past. Hacking the wsgiserver.py module is probably beyond me at this time. Probably the answer is convert to python, run on first request and consider options if it's a problem. Thanks. On Oct 28, 1:38 pm, Timothy Farrell <[EMAIL PROTECTED]> wrote: > To attempt to answer your original questions: > > 1) There is no such thing. > 2) There is no such thing. > > But to be more helpful...Java, in general, has a very sluggish startup > time. It is famous for it. In web2py, the Python interpreter is > already started so there is no need to "Preload" a web2py app. The only > difference between the web2py state before the first request and after > the first request is perhaps some stuff is loaded into either the OS > cache or the web2py cache. Also, web2py app start-times can be improved > a little by compiling them. > > You could accomplish something similar to what you want to do by > wrapping web2py in a script that starts it, waits X seconds and then > uses urllib to request the appropriate url. It's a little hackish, but > it would work. But you're not going to see dropped connections on the > first request (unless your databases are really slow) with web2py like > you do with servlets. > > If you wanted to include the functionality into web2py, then I think you > would be hacking the wsgiserver.py module. > > -tim > > billf wrote: > > I may be going down totally the wrong road but I think I am looking > > for something that is initiated by the fact the server has started as > > opposed to the server receiving a request. Does the patch address > > that? and if not, where should I be looking? in web2py or cherrypy? > > > On Oct 28, 10:54 am, achipa <[EMAIL PROTECTED]> wrote: > > >> The Pre/PostConnectionTask patch can do both outlined things, just > >> have a little patience while Massimo reviews it (wink). > > >> On Oct 28, 9:00 am, billf <[EMAIL PROTECTED]> wrote: > > >>> Voltron > > >>> Thanks for that - some facts for the cookbook there I think :-) > > >>> I'll investigate and report back. > > >>> On Oct 28, 7:16 am, voltron <[EMAIL PROTECTED]> wrote: > > >>>> Hi Billf, Ill try to have a go at answering :-) > > >>>> 1. Functions in controller are called in order in the web2py > >>>> controllers, so defining and calling , for example, a function called > >>>> def foo() before your index() action would be executed first > > >>>> 2. I think an appliance called "init" is alwas executed imediately as > >>>> default if it does not find the "welcome" appliance. I use it as a > >>>> starting point and re-directi to other appliances from there. > > >>>> I hope I could help a bit > > >>>> On 28 Okt., 07:47, billf <[EMAIL PROTECTED]> wrote: > > >>>>> Coming from Java servlets, I find a couple of features useful: > > >>>>> 1) To be able to run a method when my servlet/application is first > >>>>> loaded. > > >>>>> 2) To be able to specify that the servlet/application be loaded when > >>>>> the server starts as opposed to when the first request is received. > >>>>> Obviously, this feature is useful in avoiding first request delays if > >>>>> the start up method is lengthy. > > >>>>> How would I do the above in web2py? > > > > tfarrell.vcf > < 1KViewDownload --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

