diff --git a/include/ftxui/component/receiver.hpp b/include/ftxui/component/receiver.hpp index e1a1c2c..86874fe 100644 --- a/include/ftxui/component/receiver.hpp +++ b/include/ftxui/component/receiver.hpp @@ -21,8 +21,8 @@ namespace ftxui { // --------------- // // auto receiver = MakeReceiver(); -// auto sender_1= receiver.MakeSender(); -// auto sender_2 = receiver.MakeSender(); +// auto sender_1= receiver->MakeSender(); +// auto sender_2 = receiver->MakeSender(); // // Then move the senders elsewhere, potentially in a different thread. // @@ -83,6 +83,11 @@ class ReceiverImpl { return false; } + bool HasPending() { + std::unique_lock lock(mutex_); + return !queue_.empty(); + } + private: friend class SenderImpl;