Hi!

Some of you already know that I've committed a notifier loop based on
twisted.  This one doesn't use threads to run the notifier and twisted
loops separately but actually uses the default twisted rector
(selectrector) as the main loop.

Since twisted and kaa/pynotifier handle sockets and timers in a similar
way (and both are asynchronous main loops) I was able to hook them
together pretty well.  The file of interest is
kaa/trunk/base/src/notifier/pynotifier/nf_twisted.py.  To use this
notifier you must call kaa.notifier.init('twisted_experimental').  Once
this is deemed bug free I think we'll rename it 'twisted' and move that
one to 'twisted_threaded' (or remove one of the threaded ones?).

This one could use some more testing.  I think recordserver is a good
candidate (1.x branch).  Attached is a quick patch.

Duncan, can you test this out?  Everyone else is welcome to test as
well, the more feedback the better.  If it works we can make it the
default for recordserver.

Thanks,
-Rob



Index: src/helpers/recordserver.py
===================================================================
--- src/helpers/recordserver.py	(revision 10268)
+++ src/helpers/recordserver.py	(working copy)
@@ -1714,7 +1714,7 @@
 
 
 def main():
-    kaa.notifier.init('twisted')
+    kaa.notifier.init('twisted_experimental')
 
     socket = (config.RECORDSERVER_IP, config.RECORDSERVER_PORT2)
     secret = config.RECORDSERVER_SECRET
@@ -1730,9 +1730,7 @@
 
     reactor.listenTCP(config.RECORDSERVER_PORT, server.Site(rs))
     rs.startMinuteCheck()
-    reactor.run()
-    _debug_('reactor stopped.')
-    kaa.notifier.shutdown()
+    kaa.main()
     _debug_('kaa.notifier stopped.')
 
     #kaa.notifier.AtTimer(rs.handleTimer).start(sec=45)

Attachment: signature.asc
Description: OpenPGP digital signature

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to