[weboob] Scheduler, Bcall and threads

Christophe Benz christophe.benz at gmail.com
Thu May 20 11:53:17 CEST 2010


Le Thu, 20 May 2010 10:57:29 +0200,
Romain Bignon <romain at peerfuse.org> a écrit :

> Hi,
> 
> Currently we use threads in weboob to do calls to backends, to
> optimize performances. Threads are also used in the default scheduler.
> 
> Firstly, there is a big problem in the current state, because when an
> application uses threads (during bcall or with scheduler), it is NOT
> possible to SIGTERM the application (KeyboardInterrupt). It would be
> *really* important to solve this problem.

I agree.

> Then, I don't know if it's a good idea to use threads with the default
> scheduler. It's usefull for example to not block application (for
> example if a task takes lot of time). But the problem is that in
> other schedulers (for example the QtApplication one), they are run in
> the main thread. As backends don't know what scheduler they use, it
> is not a good thing to have several behaviors.

I think it is a good idea to use threads by default. I headed that it is
possible to execute the Gtk main loop in a separate thread.
http://www.aclevername.com/articles/python-webgui/#launching-the-toolkit-in-a-separate-thread


> A little remark about the default scheduler. As Christophe you have
> changed the behavior to run immediately a repeated task, it's run in
> the main thread, so it blocks the application the first time.

This wasn't intentional to block the main thread. We could start a
timer with interval = 0 instead of launching directly the function.

 
> Romain


-- 
Christophe Benz
http://cbenz.pointique.org



More information about the weboob mailing list