mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
refs #687, further performance improvements
* avoid redundant reads by excluding entities which will be periodically updated * restart timers when data are received, avoid overlapping requests
This commit is contained in:
@@ -59,6 +59,10 @@ namespace BlackCore
|
||||
//! \threadsafe
|
||||
int interval() const;
|
||||
|
||||
//! Is timer running
|
||||
//! \threadsafe
|
||||
bool isTimerActive() const;
|
||||
|
||||
//! Set inverval from settings and start
|
||||
void setIntervalFromSettingsAndStart();
|
||||
|
||||
@@ -68,7 +72,7 @@ namespace BlackCore
|
||||
void gracefulShutdown();
|
||||
|
||||
protected:
|
||||
QTimer *m_updateTimer = nullptr; //!< update timer
|
||||
QTimer *m_updateTimer = nullptr; //!< update timer
|
||||
mutable QReadWriteLock m_lock {QReadWriteLock::Recursive}; //!< lock which can be used from the derived classes
|
||||
|
||||
//! Constructor
|
||||
@@ -94,6 +98,10 @@ namespace BlackCore
|
||||
//! \threadsafe
|
||||
void setInterval(int updatePeriodMs);
|
||||
|
||||
//! Restart timer
|
||||
//! \threadsafe
|
||||
void restartTimer(bool onlyWhenActive = false);
|
||||
|
||||
//! Stores new content hash and returns if content changed (based on hash value
|
||||
//! \threadsafe
|
||||
bool didContentChange(const QString &content, int startPosition = -1);
|
||||
|
||||
Reference in New Issue
Block a user