Activities: allow empty wakers (#27335)

reviewable/pr27347/r1
Craig Tiller 3 years ago committed by GitHub
parent f97bf05169
commit 29948df4ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/core/lib/promise/activity.h
  2. 5
      test/core/promise/activity_test.cc

@ -78,7 +78,7 @@ class Waker {
private:
class Unwakeable final : public Wakeable {
public:
void Wakeup() final { abort(); }
void Wakeup() final {}
void Drop() final {}
};

@ -252,6 +252,11 @@ TEST(ActivityTest, WithContext) {
EXPECT_TRUE(done);
}
TEST(WakerTest, CanWakeupEmptyWaker) {
// Empty wakers should not do anything upon wakeup.
Waker().Wakeup();
}
} // namespace grpc_core
int main(int argc, char** argv) {

Loading…
Cancel
Save