Comment 1 for bug 1170523

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote : Re: notify when a contract is added or removed

I'd go for the simple way with having just one signal. The primary reason is that it's very future-proof and easier to implement in clients.

Individual signals for various changes sound like they would work faster, but deltas might get more costly than a full reload if we change the state of a lot of contracts at once. For example, I pull the network plug and 2/3 of contracts go off, that'd be a lot of d-bus signalling back and forth and individual updates too, all competing for CPU time. Simply reloading the list with one signal would be much better performance-wise in this case. Even now Contractor itself waits for a little while before reloading contracts - 100ms (AFAIR) after the last change to its files and *then* reloads them just once.

And it's not like we have to care about performance of passing a bunch of strings around in the first place. If it turns out to be slow, we can always add more fine-grained callbacks.