DataEngine and regular polling.

Aaron J. Seigo aseigo at kde.org
Tue Jul 13 22:07:36 CEST 2010


On July 13, 2010, Thomas Fjellstrom wrote:
> 1. if I let the Applet set an update frequency in connectSource, many
> setData's in the data engine just aren't passed on to the Applet. Thats
> probably intended, but it is somewhat annoying.

if it's annoying, it's most likely due to misusing DataEngine.

there are two kinds of data:

a) that which is updated by the DataEngine whenever appropriate, because it 
knows when that is. in those caes, the visualizations just connect to the 
source and are updated whenever new data arrives.

b) data that the visualization will ask for every so many ms because it knows 
how often it wants updates on that data

there is no third option. imagine how annoying it would be if a visualization 
said "every 100ms, please" because it's showing a graph or some such over time 
... and the engine pushed data every 10ms, or every 500ms (because that's when 
the next change to the data actually came in, e.g.)

so a vizualiation needs to decide: is this data that i wish to poll at regular 
intervals, or is this data that i want to be notified of changes to?

if the visualization sets a polling interval, then setData calls by the 
DataEngine will not necessarily end up causing an immediate dataUpdated call 
in the visualization.

there are some cases where the DataEngine needs to force such an update, but 
that's usually when something like the network coming back up happens. there 
is a way to do that: forceImmediateUpdateOfAllVisualizations(). it's a long 
name, yes. it's also something you almost never want to use.

> 2. DataEngine::setPollingInterval seems to poll only once.

yes, that's an engine-wide polling interval.

-- 
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/20100713/f4150dc5/attachment.sig 


More information about the Plasma-devel mailing list