DataEngine and regular polling.

Aaron J. Seigo aseigo at kde.org
Wed Jul 14 19:17:17 CEST 2010


On July 13, 2010, Thomas Fjellstrom wrote:
> To explain, the data engine will do a DNS lookup, arp lookup, and a shell
> out to ping (that runs for about 5 seconds per host), when an update is
> requested. The data engine can not wait for them to finish, otherwise it'd
> block for possibly (if DNS is having issues) tens of seconds at a time, per
> host.
> 
> So what should I do here?

if a timeout is requested, but no data can be filled immediately, then once 
setData is called on the source, at that point the visualization should be 
notified.

in your case, it sounds like there are multiple setData calls, however. so the 
first one probably triggers an update, and the subsequent ones (e.g. the ping) 
waits for the next timeout.

one way around that is to not use the setData API in DataEngine, but to 
instead create subclasses of DataContainer for each sourc. when all the data 
is retreived, then the DataContainer can call checkForUpdate(). that should 
work better for your use case.
 
> > > 2. DataEngine::setPollingInterval seems to poll only once.
> > 
> > yes, that's an engine-wide polling interval.
> 
> I mean once period. I expected it to actually setup a regular poll, not a
> one shot timer.

that was a bug; i've just fixed it. it now does set up a regular poll as it is 
supposed to :)

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20100714/9494b87f/attachment.sig 


More information about the Plasma-devel mailing list