|
@@ -1,5 +1,5 @@
|
|
|
|
|
|
- * Copyright (c) 2017 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
|
+ * Copyright (c) 2017-2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
|
*
|
|
|
* @author David Sehnal <david.sehnal@gmail.com>
|
|
|
*/
|
|
@@ -10,19 +10,20 @@ import { ExecuteObservable, ExecuteObservableChild, ExecuteInContext } from './e
|
|
|
import { SyncRuntimeContext } from 'mol-task/execution/synchronous';
|
|
|
import { idFactory } from 'mol-util/id-factory';
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
interface Task<T> {
|
|
|
-
|
|
|
+
|
|
|
run(): Promise<T>,
|
|
|
-
|
|
|
+
|
|
|
run(observer: Progress.Observer, updateRateMs?: number): Promise<T>,
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ * Run a child task that adds a new node to the progress tree. Allows to passing the progress so
|
|
|
+ * that the progress tree can be kept in a "good state" without having to separately call update.
|
|
|
+ */
|
|
|
runAsChild(ctx: RuntimeContext, progress?: string | Partial<RuntimeContext.ProgressUpdate>): Promise<T>
|
|
|
|
|
|
-
|
|
|
+
|
|
|
runInContext(ctx: RuntimeContext): Promise<T>
|
|
|
|
|
|
readonly id: number,
|