feat(task): add task labels and push-based task events
This commit is contained in:
@@ -20,6 +20,20 @@
|
||||
- **BufferRunner**: When `catchErrors: false`, buffered task errors now reject the trigger promise (via `CycleCounter.informOfCycleError`) instead of silently resolving with `undefined`
|
||||
- **TaskChain stubs completed**: `removeTask(task)` returns `boolean`, `shiftTask()` returns `Task | undefined`
|
||||
|
||||
## Task Labels (v4.1.0+)
|
||||
- `Task` constructor accepts optional `labels?: Record<string, string>`
|
||||
- Helper methods: `setLabel(key, value)`, `getLabel(key)`, `removeLabel(key)`, `hasLabel(key, value?)`
|
||||
- `getMetadata()` includes `labels` (shallow copy)
|
||||
- `TaskManager.getTasksByLabel(key, value)` returns matching `Task[]`
|
||||
- `TaskManager.getTasksMetadataByLabel(key, value)` returns matching `ITaskMetadata[]`
|
||||
|
||||
## Push-Based Events (v4.1.0+)
|
||||
- `Task.eventSubject`: rxjs `Subject<ITaskEvent>` emitting `'started'`, `'step'`, `'completed'`, `'failed'` events
|
||||
- `TaskManager.taskSubject`: aggregated `Subject<ITaskEvent>` from all added tasks
|
||||
- `TaskManager.removeTask(task)` unsubscribes and removes from map
|
||||
- `TaskManager.stop()` cleans up all event subscriptions
|
||||
- Exported types: `ITaskEvent`, `TTaskEventType`
|
||||
|
||||
## Project Structure
|
||||
- Source in `ts/`, web components in `ts_web/`
|
||||
- Tests in `test/` - naming: `*.node.ts`, `*.browser.ts`, `*.both.ts`
|
||||
|
||||
Reference in New Issue
Block a user