Jason Tackaberry wrote:
> On Tue, 2007-02-27 at 18:03 +0100, Dirk Meyer wrote:
>> or even simpler:
>> 
>> | @kaa.notifier.execute_in_mainloop()
>> | def add_channel(self, tuner_id, name, long_name):
>
> This is still magical to me. :)

Maybe I should write some doc about it :)
In short: when called from mainloop this is a normal function call, it
this function is called from a thread the thread is blocked, the
function called in the mainloop and then back. Just like
MainThreadCallback. 

My personal favorite is @yield_execution


>> And a new add_program will work in a queue:
>> 
>> | def add_program(self, channel_db_id, start, stop, title, **attributes):
>> |     if not kaa.notifier.is_mainthread:
>> |          while len(program_queue) > 100:
>> |              time.sleep(0.1)
>> |          program_queue.append(...)
>> |          wakeup(program_queue_poll)
>> |          return
>> |     current code
>
> What does the wakeup() call do?  From what I can see wakeup() doesn't
> take any arguments.  (Maybe we should rename this to wake_mainthread()
> just to be more explicit?)

wakeup wasn't a specific function we have, just something I made up
for hacking this pseudo code.


Dischi

-- 
Whoever coined the phrase "Quiet as a mouse" has never stepped on one.

Attachment: pgp4iv0JzMh2Z.pgp
Description: PGP signature

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to