On Monday 03 March 2014 23:35:14 David Rosca wrote: > How exactly do you want to make the library async? I can see that there is > a BlueDevil::asyncCall (for Device class) method for making async calls. > Should the other classes be made asynchronous this way too (so both > synchronous > and asynchronous API is available)? > Or change the API, that it will only be available asynchronous? > > Thanks, > David Rosca > > [1] https://github.com/nowrep > [2] > https://google-melange.appspot.com/gsoc/proposal/review/google/gsoc2013/nowr > ep/5681726336532480
Since libbluedevil is mostly a dbus wrapper of BlueZ I would use
QDBusPendingReplyWatcher and wrap it with different jobs (or QFutures?), so the
api would look something like this:
QBluezFetchDeviceInfo *jobInfo = Manager::self()->device("XX:xx:xx:xx:xx:x");
connect(jobIInfo, SIGNAL(finished()), SLOT(fetchInfoFinished());
jobInfo->start();
Note that I have used QBluez, I would like to rename it to that as well.
Also as part of the GSoC libbluedevil should be ported internally to this new
async library, so I guess that jobs could have an aditional method making
their execution sync, kinda:
jobInfo->exec();
That will use an internal QEventLoop to block execution until finished is
emitted.
Also, we could do this using Qt5 so we can use lambdas and other nice stuff :)
Cheres!
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Kde-hardware-devel mailing list [email protected] https://mail.kde.org/mailman/listinfo/kde-hardware-devel
