Re: [Rhythmbox-devel] plugins and threads

Thanks, yes this helps.

Actually I came across this solution too, a few minutes ago :)


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>
> ALWAYS      -
> BUILDS      -
> --
> 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

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]