Re: [Rhythmbox-devel] plugins and threads
- From: Christian Buennig <masala web de>
- To: rhythmbox-devel gnome org
- Subject: Re: [Rhythmbox-devel] plugins and threads
- Date: Mon, 01 Oct 2007 21:09:12 +0200
Thanks, yes this helps.
Actually I came across this solution too, a few minutes ago :)
Christian
Adam Zimmerman wrote:
> On Mon, 2007-01-10 at 17:49 +0200, Christian Buennig wrote:
>> But since I prefer to write my plugin in Python: Does anyone have an
>> idea to implement a server plugin without an extra thread? A solution
>> might be to let Rhythmbox periodically "tick" my plugin so that the
>> plugin can inspects its sockets for incoming data with non-blocking IO,
>> but I do not know how to get such a periodic "tick" from Rhythmbox.
>
> To do specifically what you're asking, you can use gobject.idle_add() or
> gobject.timeout_add(), which will add set a callback function to be run
> when rhythmbox is idle (1st), or after a certain time has passed (2nd).
> These functions run in the main thread, so they shouldn't take too long
> to execute or the UI will freeze up.
>
> There might be a better way to do this, possibly using the gnomevfs
> async functions, although I don't know if they really apply to running a
> server.
>
> Hope this helps.
>
> --
> Adam Zimmerman <adam_zimmerman sfu ca>
>
> CREATIVITY - http://mirrors.creativecommons.org/movingimages/Building_on_the_Past.mpg
> ALWAYS - http://www.musiccreators.ca/
> BUILDS - http://www.ubuntu.com/
> ON THE PAST - http://www.theopencd.org/
> --
>
> Microsoft is not the answer.
> Microsoft is the question.
> NO (or Linux) is the answer.
> -- Taken from a .signature from someone from the UK, source unknown
>
> _______________________________________________
> rhythmbox-devel mailing list
> rhythmbox-devel gnome org
> http://mail.gnome.org/mailman/listinfo/rhythmbox-devel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]