mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-29 14:45:53 +08:00
Add Receiver->HasPending()
This commit is contained in:
parent
823e0906da
commit
883b34503d
@ -21,8 +21,8 @@ namespace ftxui {
|
||||
// ---------------
|
||||
//
|
||||
// auto receiver = MakeReceiver<std:string>();
|
||||
// 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<std::mutex> lock(mutex_);
|
||||
return !queue_.empty();
|
||||
}
|
||||
|
||||
private:
|
||||
friend class SenderImpl<T>;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user