forked from qt-creator/qt-creator
TaskTree: Introduce withTimeout()
Make it available for Group or CustomTask items. Note, that when withTimeout() is used, the total number of tasks grows by one. Change-Id: Idc71737ba66b92bdc4bf17599c793b1127d22f5e Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -187,6 +187,8 @@ protected:
|
||||
static TaskItem groupHandler(const GroupHandler &handler) { return TaskItem({handler}); }
|
||||
static TaskItem parallelLimit(int limit) { return TaskItem({{}, limit}); }
|
||||
static TaskItem workflowPolicy(WorkflowPolicy policy) { return TaskItem({{}, {}, policy}); }
|
||||
static TaskItem withTimeout(const TaskItem &item, std::chrono::milliseconds timeout,
|
||||
const GroupEndHandler &handler = {});
|
||||
|
||||
private:
|
||||
Type m_type = Type::Group;
|
||||
@@ -216,6 +218,11 @@ public:
|
||||
using TaskItem::parallelLimit; // Default: 1 (sequential). 0 means unlimited (parallel).
|
||||
using TaskItem::workflowPolicy; // Default: WorkflowPolicy::StopOnError.
|
||||
|
||||
TaskItem withTimeout(std::chrono::milliseconds timeout,
|
||||
const GroupEndHandler &handler = {}) const {
|
||||
return TaskItem::withTimeout(*this, timeout, handler);
|
||||
}
|
||||
|
||||
private:
|
||||
template<typename SetupHandler>
|
||||
static GroupSetupHandler wrapGroupSetup(SetupHandler &&handler)
|
||||
@@ -329,6 +336,11 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
TaskItem withTimeout(std::chrono::milliseconds timeout,
|
||||
const GroupEndHandler &handler = {}) const {
|
||||
return TaskItem::withTimeout(*this, timeout, handler);
|
||||
}
|
||||
|
||||
private:
|
||||
template<typename SetupFunction>
|
||||
static TaskItem::TaskSetupHandler wrapSetup(SetupFunction &&function) {
|
||||
|
||||
Reference in New Issue
Block a user