@lde/task-runner 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Task Runner
|
|
2
2
|
|
|
3
|
-
Interfaces for running
|
|
3
|
+
Interfaces for running shell commands as tasks. Implementations run commands:
|
|
4
4
|
|
|
5
|
-
- [in Docker](../task-runner-docker)
|
|
6
|
-
- [natively on the host](../task-runner-native)
|
|
5
|
+
- [in Docker containers](../task-runner-docker) — isolated environment
|
|
6
|
+
- [natively on the host](../task-runner-native) — direct execution
|
|
7
|
+
|
|
8
|
+
## TaskRunner Interface
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
interface TaskRunner<Task> {
|
|
12
|
+
run(command: string): Promise<Task>;
|
|
13
|
+
wait(task: Task): Promise<string>;
|
|
14
|
+
stop(task: Task): Promise<string | null>;
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
- `run(command)` — Start a shell command, returns a task handle
|
|
19
|
+
- `wait(task)` — Wait for completion, returns stdout/stderr output
|
|
20
|
+
- `stop(task)` — Stop the task, returns output collected so far
|