std::shared_ptr<void> TelemetryWorker::processWorkItem(WorkItem &workItem) { processOneItem(workItem.m_Item); if (workItem.isMilestone()) { // force context switch for more imporant tasks QThread::msleep(TELEMETRY_SLEEP_MILLIS); } return std::shared_ptr<void>(); }
std::shared_ptr<Artworks::ArtworkMetadata> SpellCheckWorker::processWorkItem(WorkItem &workItem) { std::shared_ptr<Artworks::ArtworkMetadata> result; if (workItem.isSeparator()) { emit queueIsEmpty(); } else { this->processSpellingQuery(workItem.m_Item); if (workItem.isMilestone()) { QThread::msleep(SPELLCHECK_WORKER_SLEEP_DELAY); } result = std::dynamic_pointer_cast<Artworks::ArtworkMetadata>(workItem.m_Item->getBasicModelSource()); } return result; }