[Kde-hardware-devel] [GSoC] Project: Make Libbluedevil Async

Àlex Fiestas afiestas at kde.org
Thu Mar 6 10:24:20 UTC 2014


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!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-hardware-devel/attachments/20140306/9f19a2c0/attachment.sig>


More information about the Kde-hardware-devel mailing list