<table><tr><td style="">kossebau added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D10078">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #8C98B8;
color: #6B748C;
font-style: italic;
margin: 4px 0 12px 0;
padding: 8px 12px;
background-color: #F8F9FC;">
<div style="font-style: normal;
padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D10078#252871" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">D10078#252871</a>, <a href="https://phabricator.kde.org/p/davidedmundson/" style="
border-color: #f1f7ff;
color: #19558d;
background-color: #f1f7ff;
border: 1px solid transparent;
border-radius: 3px;
font-weight: bold;
padding: 0 4px;">@davidedmundson</a> wrote:</div>
<div style="margin: 0;
padding: 0;
border: 0;
color: rgb(107, 116, 140);"><p>This makes it quite easy for a developer to screw up and block krunner.<br />
The RAII approach makes it very very hard for a developer to screw up with any of the multiple usage patterns.</p></div>
</blockquote>
<p>Seems we have two different main design motives then: mine was to keep the classes/concepts close to the in-process krunner plugin ones, yours is to try to lower the chance of blocked calls :)</p>
<p>Guess I am not so burned by blocked krunner plugins to give that so much weight, as I also do not see the danger of people forgetting to do any finishMatching call. And would argue that the D-Bus Krunner.side proxy should protect itself in general against remote D-Bus krunner services locking themselves up in other ways.</p>
<p>Your project, your call/decision :)</p>
<p>I propose two renames though:</p>
<ol class="remarkup-list">
<li class="remarkup-list-item">class "*Context" -> "MatchReply" (or similar/better): the "*Context" class in normal in-process krunner plugins has a different, passive purpose, also might "submit/cancel a context" not make that much sense? (non-native speaker here, might miss out phrase meanings)</li>
<li class="remarkup-list-item">request handling method name "startMatching" -> "handleMatchRequest"(or similar/better): for a method "start*" I would expect some counterpart methods on the same class/object.</li>
</ol>
<p>I could not remember a Qt/KF class following the same pattern (something like single-thread service class with a handler method to do async request replies), so no existing naming pattern handy for proposal.</p>
<p>At least I imagine that as developer having to reimplement</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">virtual void handleMatchRequest(const MatchReply::Ptr &matchReply);</pre></div>
<p>one has a better idea about what to do, compared to</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">virtual void startMatching(const RunnerContext::Ptr &context);</pre></div>
<p>Even if the mixing of request properties (query string) into the reply class spoils the concepts a little. But splitting that off into another separate object makes the code more complex again, so that trade-off could be fine.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R308 KRunner</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D10078">https://phabricator.kde.org/D10078</a></div></div><br /><div><strong>To: </strong>kossebau, broulik, davidedmundson<br /><strong>Cc: </strong>bruns, michaelh, ngraham, Frameworks<br /></div>