Dirk Meyer wrote:
> Duncan Webb wrote:
>> Dirk Meyer wrote:
>>> Duncan Webb wrote:
>>>> Dirk Meyer wrote:
>>>>> Jason Tackaberry wrote:
>>>>>> On Sun, 2007-08-26 at 07:59 -0700, Michael Beal wrote:
>>>>>>> Wouldn't it make sense to use SQLite for this instead?  The record
>>>>>>> schedule is currently a simple DB file in XML format being accessed by
>>>>>>> multiple threads.  I can see where a race condition could be created
>>>>>> Freevo 2 will use an sqlite-backed EPG (kaa.epg).
>>>>>>
>>>>>> I have no idea if it would be worth Freevo 1 going this route.  It may
>>>>>> well be more work than you'd expect.  But on the other hand, I also like
>>>>>> the idea of Freevo 1 increasingly using kaa modules, as it's an
>>>>>> excellent source of testing for these modules on which Freevo 2 is being
>>>>>> built. 
>>>>> Could be possible. It should be easy to replace the freevo mainloop
>>>>> with kaa.notifier at a minimum level so that it will work.
>>>>> kaa.notifier running is a must-have for kaa.epg. I could do it. 
>>>>> Should I?
>>>> By all means, yes that would be really good. The recordserver code has
>>>> become rather horrid :(
>>> Ah, you are talking about the recordserver. Sorry, I meant Freevo
>>> itself. The recordserver is using twisted, right? I guess someone
>>> should do a rewrite of the communication code using the XMLRPC code
>>> From kaa.base and kaa.notifier as loop.
>> You mean replacing the rc code, that would be great too.
> 
> I did a small change, patch attached. Do not include it directly, it
> breaks helpers using the rc module, I only tested freevo itself.
> 
> I removed the real mainllop part from rc. The event stuff is handled
> by kaa.notifier. This means Event object can just call a post() method
> on themself, no need for the global rc object. If somethign wants to
> listen to events, add a global eventhandler. I have done this in
> main.py, The self.event_callback is removed from rc. If someone else
> wants to get notified, run 
> kaa.notifier.EventHandler(callback_to_call).register()
> 
> Since all plugins require the rc module to call them, there is a poll
> function now calling the input plugins and the time based
> plugins. This function is called with a 0.01 sec timer. A future
> version of Freevo should not require this, plugin can register a poll
> function with a timer on their own, they can also register socket
> callbacks. For more details see
> http://freevo.sourceforge.net/cgi-bin/freevo-2.0/SourceDoc/KaaNotifier
> 
> I hope this small patch is a path for you to get rid of twisted and
> give freevo a real mainloop.

This mostly works, at least I haven't found any plug-ins that are
broken. The recordserver doesn't work.

The main problem that I'm having is how does the event mechanism work
between processes?

Attached are two test modules that are run with freevo execute but the
events don't get passed across.

What do I have to do to get this to work?

Cheers,
Duncan

BTW the KaaNotifier document is nice and easy to understand.

Attachment: kaaevents.py
Description: application/python

Attachment: kaapost.py
Description: application/python

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to