This is an automated email from the ASF dual-hosted git repository.
harbs pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new 7634649 added task helper methods
7634649 is described below
commit 7634649484b8822a4258b658536a707202737c7d
Author: Harbs <[email protected]>
AuthorDate: Tue Feb 8 11:41:09 2022 +0200
added task helper methods
---
.../org/apache/royale/utils/async/CompoundAsyncTask.as | 12 ++++++++++++
.../org/apache/royale/utils/async/SequentialAsyncTask.as | 11 +++++++++++
2 files changed, 23 insertions(+)
diff --git
a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/async/CompoundAsyncTask.as
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/async/CompoundAsyncTask.as
index 84e90d7..010ea54 100644
---
a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/async/CompoundAsyncTask.as
+++
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/async/CompoundAsyncTask.as
@@ -153,5 +153,17 @@ package org.apache.royale.utils.async
notifyDone();
}
}
+
+ /**
+ * Static helper method for invoking the task in a single expression
+ * @langversion 3.0
+ * @productversion Royale 0.9.9
+ */
+ public static function
execute(tasks:Array,callback:Function,failEarly:Boolean=false):void{
+ var task:CompoundAsyncTask = new
CompoundAsyncTask(tasks);
+ task.failEarly = failEarly;
+ task.done(callback);
+ task.run();
+ }
}
}
\ No newline at end of file
diff --git
a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/async/SequentialAsyncTask.as
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/async/SequentialAsyncTask.as
index 17651ab..6a8ec80 100644
---
a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/async/SequentialAsyncTask.as
+++
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/async/SequentialAsyncTask.as
@@ -73,5 +73,16 @@ package org.apache.royale.utils.async
setFinalStatus();
}
}
+ /**
+ * Static helper method for invoking the task in a single expression
+ * @langversion 3.0
+ * @productversion Royale 0.9.9
+ */
+ public static function
execute(tasks:Array,callback:Function,failEarly:Boolean=false):void{
+ var task:SequentialAsyncTask = new
SequentialAsyncTask(tasks);
+ task.failEarly = failEarly;
+ task.done(callback);
+ task.run();
+ }
}
}
\ No newline at end of file