mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Added the ability to block on getMessages until a message arrives
This commit is contained in:
@@ -50,7 +50,7 @@ public:
|
||||
void enableMessagePolling();
|
||||
bool disableMessagePolling();
|
||||
std::vector<std::shared_ptr<Message>> getMessages();
|
||||
bool getMessages(std::vector<std::shared_ptr<Message>>& container, size_t limit = 0);
|
||||
bool getMessages(std::vector<std::shared_ptr<Message>>& container, size_t limit = 0, std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
|
||||
size_t getCurrentMessageCount() { return pollingContainer.size_approx(); }
|
||||
size_t getPollingMessageLimit() { return pollingMessageLimit; }
|
||||
void setPollingMessageLimit(size_t newSize) {
|
||||
@@ -145,7 +145,7 @@ private:
|
||||
void updateLEDState();
|
||||
|
||||
size_t pollingMessageLimit = 20000;
|
||||
moodycamel::ConcurrentQueue<std::shared_ptr<Message>> pollingContainer;
|
||||
moodycamel::BlockingConcurrentQueue<std::shared_ptr<Message>> pollingContainer;
|
||||
void enforcePollingMessageLimit();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user