mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-10-30 16:07:38 +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