D23099: Allow sending a port message and receive a reply
Kai Uwe Broulik
noreply at phabricator.kde.org
Sun Aug 11 17:22:40 BST 2019
broulik created this revision.
broulik added reviewers: Plasma, davidedmundson, fvogt.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
broulik requested review of this revision.
REVISION SUMMARY
Instead of manually matching a sent message to a port message, allow adding a serial which is then used to relate a reply back so you just get a neat Promise-based API.
For compatibility, the existing method cannot be changed, as with new extension and older host I will never get a reply, and I cannot tell whether the caller actually asked for the promise or not and if they didn't we would leak the promise resolvers as we never got a reply.
TEST PLAN
Placed a `sendReply` call in a `handleData`
sendPortMessageWithReply("settings", "getSubsystemStatus").then((message) => {
console.log("got the status", message);
});
REPOSITORY
R856 Plasma Browser Integration
REVISION DETAIL
https://phabricator.kde.org/D23099
AFFECTED FILES
extension/extension-utils.js
extension/extension.js
host/abstractbrowserplugin.cpp
host/abstractbrowserplugin.h
host/pluginmanager.cpp
To: broulik, #plasma, davidedmundson, fvogt
Cc: plasma-devel, LeGast00n, jraleigh, fbampaloukas, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190811/c1215d34/attachment.html>
More information about the Plasma-devel
mailing list