Python Signal Emitter Race Condition Question

Thiago Macieira thiago at kde.org
Wed Aug 1 09:51:17 PDT 2007


Jim Kytola wrote:
>For full disclosure, I have another script that listens for
> NameOwnerChanged and when it finds the org.mozilla.thunderbird.DBus
> change, connects a callback function to the NewMail signal - so by
> successful run, I mean the callback function gets fired. It's certainly
> possible that my problem is on that side, but it does seem strange that
> I'm seeing the NewMail signal before the GetNameOwner method call in
> the bad run.

This is your problem: you're waiting for the application to register.

Don't.

Connect the signal as soon as the listener starts. When the application 
starts, register and emits the signal, your listener will have already 
set everything up. In fact, it won't even need to listen for the 
NameOwnerChanged signal.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freedesktop.org/archives/dbus/attachments/20070801/adfeddc7/attachment.pgp 


More information about the dbus mailing list