Jason Tackaberry wrote: > On 2007-10-23 01:46, Duncan Webb wrote: >> I have a little bit of a problem with the recordserver not getting >> events from it's plug-ins. The problem is that kaa.notifier.loop() and >> app.run() don't return so I can't have both in a program, can I? > > Ideally app.run() just calls something like app.step() in a loop, then > you can do kaa.signals['step'].connect(app.step) > > Alternatively, if you can hook custom functions to be called every > iteration of the app.run() loop, you can call kaa.notifier.step there. > But this is suboptimal because it means timer precision will be way off, > and watches on file descriptors will be sluggish.
I think that as you seem to suggest this is not the best solution. It was dead easy to change the recordserver to use kaa.rpc but I'm not 100% sure what I need to do with the client in order to check that the connection is okay, and to synchronise the result from the handler with the return value of the function. From what I see in the code signals need to be use from the kaa.notifier.loop(). Do you have a nice simple example? Is it possible to pass a class to the rpc client in the same way as the server? Here is a bit of code from the upsoon plug-in: def findNextProgram(self): """ returns the next program that will be recorded """ _debug_('findNextProgram(self)', 2) serverup = True try: x = self.server.rpc('findNextProgram').connect(self.handle_result) print 'x=%r' % x except TypeError, e: _debug_('findNextProgram:%s' % e, DINFO) pass except Exception, e: serverup = False if sys.exc_type != socket.error: traceback.print_exc() _debug_('findNextProgram:%s' % e, 0) if self.serverup != serverup: self.serverup = serverup if serverup: _debug_('The record server is up') else: _debug_('The record server is down') return next_program Here I could use the PluginInterface class. The code to check if the server is running needs updating. Thanks Duncan ------------------------------------------------------------------------- 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 Freevo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freevo-devel