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: Tue, 02 Oct 2007 10:59:36 +0200
Hi Mike,
this would be a better solution, but I have to test if it really works
for me. The point is that the actual socket handling is done in a C
library which I use from the Rhythmbox plugin via a Python - C - Wrapper
for that library.
So I wonder if I can do an io_add_watch within the C library (using
g_io_add_watch from glib) .. or more abstract if I can add watches to
the _same_ main loop from within python using gobject and within C using
glib. ... btw: can one process have more than one main loop?
I'll just test it and will report the results..
Thanks for the feedback so far,
Christian
Michael Gratton wrote:
> Hey Christian,
>
> On Mon, 2007-10-01 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.
>
> If you have a select'able object (file, socket, etc) also check out
> gobject.io_add_watch(). I'm using it in Rhythmweb to get a callback when
> an incoming http request is received, it works really well.
>
> /Mike
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]