[PATCH] D51996: [clangd] Simplify cancellation public API

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 12 14:10:12 PDT 2018


kadircet added a comment.

Seems a lot cleaner now, thanks!

Do you plan to have other changes like moving control to JSONRPCDispatcher and recording timings for analysis on this patch? If not maybe we can add some fixme's so that we won't forget. Also the somewhat "caching" of cancellation token from previous implementation might still be useful in future if we really face "crowded" contexts and frequent cancellation checks, so maybe keep some notes about it?



================
Comment at: clangd/Cancellation.h:29
+// 2. Library code that executes long-running work, and can exit early if the
+//   result is not needed.
 //
----------------
Maybe also mention propagating context into long-running work. runAsync does that implicitly and not sure if there will be other use cases that doesn't include it, but if there might be it would be nice to point it out as well.


================
Comment at: clangd/Cancellation.h:44
+//   (A real example may invoke the callback with an error on cancellation,
+//   the TaskCancelledError is provided for this purpose).
 //
----------------
s/TaskCancelledError/CancelledError


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D51996





More information about the cfe-commits mailing list