(A)synchronous DataEngines?
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Fri Mar 7 23:22:48 CET 2008
Hi all,
inside a data engine I'd like to request some data via http. There is the
QHttp class I could use as well as KIO. Both of them seem to be asynchronous.
Now I ran into trouble combining those with DataEngines for the following
reason:
In my data engine, data is fetched asynchronously via QHttp each time
updateSource gets called. After sending the request, the method returns false,
while the QHttp object is waiting for a response. When new data is available,
it is applied using setData, but the visualizations don't get updated until
updateSource gets called next time. Even worse, this results in old data to
be displayed. So I wonder what the proper way is to implement asynchronous
data retrieval?
Of course, there is also synchronous data fetching. I'm not sure whether KIO
can do this. I've seen code for this using a raw tcp socket, but I'd rather
have high-level http access to the data. Anyway, blocking is probably not an
option here since it blocks the whole applet (or even plasma), right?
Any hints are very welcome. Thanks in advance!
Best whishes,
Bernhard
More information about the Panel-devel
mailing list