[web2py] Re: A basic problem about threading and time consuming function...

2016-05-05 Thread Mirek Zvolský
Debian/nginx/systemd deployment: I made scheduler working with help: https://groups.google.com/d/msg/web2py/eHXwines4o0/i3WqDlKjCQAJ and https://groups.google.com/d/msg/web2py/jFWNnz5cl9U/UpBSkxf4_2kJ Thank you very much Niphlod, Michael M, Brian M Dne čtvrtek 5. května 2016 13:06:04 UTC+2

[web2py] Re: A basic problem about threading and time consuming function...

2016-05-05 Thread Mirek Zvolský
Yes. I run with scheduler already. It is really nice and great ! Going away from the ajax solution it was easy and there was almost no problem. (I have very easy parameters for the task and I return nothing, just I save into db.) The result code is cleaner (one task starting call instead of

[web2py] Re: A basic problem about threading and time consuming function...

2016-05-03 Thread Niphlod
NP: as everything it's not the silver bullet but with the redis incarnation I'm sure you can achieve less than 3 second (if you tune heartbeat even less than 1 second) from when the task gets queued to when it gets processed. On Tuesday, May 3, 2016 at 12:32:13 PM UTC+2, Mirek Zvolský wrote: >

[web2py] Re: A basic problem about threading and time consuming function...

2016-05-03 Thread Mirek Zvolský
Hi, Niphlod. After I have read something about scheduler, I am definitively sorry for my previous notes and I choose web2py scheduler of course. It will be my first use of it (with much older ~3 years web2py app I have used cron only), so it will take some time to learn with scheduler. But it

[web2py] Re: A basic problem about threading and time consuming function...

2016-05-02 Thread Mirek Zvolský
You are right. At this time it works for me via ajax well and I will look carefully for problems. If so, I will move to scheduler. I see this is exactly what Massimo(?) writes at the bottom of Ajax chapter of the book. PS: about times: At notebook with mobile connection it takes 20-40s. So it

[web2py] Re: A basic problem about threading and time consuming function...

2016-05-01 Thread Niphlod
the statement "I don't need to use the scheduler, because I want to start it as soon as possible" is flaky at best. If your "fetching" varies from 2 to 20 seconds and COULD extend further to 60 seconds, waiting a few seconds for the scheduler to start the process is uhm... debatable. Of

[web2py] Re: A basic problem about threading and time consuming function...

2016-05-01 Thread Mirek Zvolský
Thanks for info and tips, 6 years later. What I try to do is a form with single input, where user gives a query string and then data about (usually ~300) books will be retrieved via z39 and marc protocol/format, parsed and saved into local database. Of course this will take a time (2? 5? 20?

Re: [web2py] Re: A basic problem about threading and time consuming function...

2010-06-02 Thread Doug Warren
I started looking at this a bit, you can find the specs for the Comet protocol, such as it is at http://svn.cometd.com/trunk/bayeux/bayeux.html It's built on top of JSON but isn't quite JSON-RPC. More of a publish/subscribe model. The latest version of 'cometd' just released a beta release

Re: [web2py] Re: A basic problem about threading and time consuming function...

2010-05-27 Thread Giuseppe Luca Scrofani
Thanks all for answering friends! I've extracted some good info from this discussion, and the solution proposed by Massimo work well :)

[web2py] Re: A basic problem about threading and time consuming function...

2010-05-26 Thread Allard
I won't have time to work out a async proof of concept at this time. I hope to get this after some more real world profiling with my web2py app though. To give you an idea of how an async web framework could feel as natural in programming style as web2py (eg. no call backs all over the place),

[web2py] Re: A basic problem about threading and time consuming function...

2010-05-25 Thread mdipierro
I would use a background process that does the work and adds the items to a database table. The index function would periodically refresh or pull an updated list via ajax from the database table. there is no way for te server to trigger an action in the browser unless 1) the browser initiates it

[web2py] Re: A basic problem about threading and time consuming function...

2010-05-25 Thread Candid
Well, actually there is a way for the server to trigger an action in the browser. It's called comet. Of course under the hood it's implemented on top of http, so it's browser who initiates request, but from the developer perspective it looks like there is dual channel connection between the

[web2py] Re: A basic problem about threading and time consuming function...

2010-05-25 Thread Allard
It seems like Comet would be hard to implement in web2py. Does web2py use a threadpool internally? If so, I can see you run out of threads pretty quickly. Ideally you would like to solve these kind of problems with an asynchronous model (think Gevent, Eventlet, Concurrence, Toranado). I am working

[web2py] Re: A basic problem about threading and time consuming function...

2010-05-25 Thread Allard
Comet is a nice way to get this done but I wonder how to implement comet efficiently in web2py. Massimo, does web2py use a threadpool under the hood? For comet you would then quickly run out of threads. If you'd try to do this with a thread per connection things would get out of hand pretty

[web2py] Re: A basic problem about threading and time consuming function...

2010-05-25 Thread mdipierro
On May 25, 9:24 pm, Allard docto...@gmail.com wrote: Comet is a nice way to get this done but I wonder how to implement comet efficiently in web2py. I have never used comet but I do not see any major problem Massimo, does web2py use a threadpool under the hood? For comet you would then