DataEngine and regular polling.

Thomas Fjellstrom tfjellstrom at shaw.ca
Wed Jul 14 08:28:57 CEST 2010


On July 13, 2010, Aaron J. Seigo wrote:
> 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.

Yeah, I figured as much. The data engine however will want to update some 
parts of a source's data asynchronously, after the visualization has 
requested an update. Sadly that doesn't work. I wish it would though. 
Waiting for the next update is just too long of a wait. Most people are 
probably going to want to set the polling interval to several minutes or 
more.

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?

> > 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.

-- 
Thomas Fjellstrom
tfjellstrom at shaw.ca


More information about the Plasma-devel mailing list