From ad7fbc1e922dfed74a857fbdcd0c30adff90a868 Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Thu, 7 Mar 2024 16:21:50 -0800 Subject: [PATCH] [EventEngine] Document RunAfter can return an invalid handle for immediate execution (#36072) Closes #36072 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36072 from drfloob:docs/runafter-immediate-invalid-handle 4ce2dd7dd1f0454335a8e86faca1f2dd7e898b14 PiperOrigin-RevId: 613737590 --- include/grpc/event_engine/event_engine.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/grpc/event_engine/event_engine.h b/include/grpc/event_engine/event_engine.h index 727fb6ddfee..93c94664bc5 100644 --- a/include/grpc/event_engine/event_engine.h +++ b/include/grpc/event_engine/event_engine.h @@ -444,6 +444,9 @@ class EventEngine : public std::enable_shared_from_this, /// /// Implementations must not execute the closure in the calling thread before /// \a RunAfter returns. + /// + /// Implementations may return a \a kInvalid handle if the callback can be + /// immediately executed, and is therefore not cancellable. virtual TaskHandle RunAfter(Duration when, Closure* closure) = 0; /// Synonymous with scheduling an alarm to run after duration \a when. ///