Documentation
¶
Overview ¶
Package taskevent provides a decoupled, context-scoped event bus for task lifecycle progress. Producers (task implementations) emit events via Emit; consumers (e.g. the API progress store, the Telegram message editor) register as Sinks and are injected through context. This keeps the task layer free of any concrete progress-display dependency, so new task types gain progress reporting for free and new observers can be added without touching tasks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Event ¶
type Event struct {
TaskID string
Phase Phase
TotalBytes int64
DownloadedBytes int64
TotalFiles int
DownloadedFiles int
Err error
}
Event describes a single progress observation for a task. Byte fields are populated by byte-stream tasks; file-count fields by count-based tasks. A task may fill whichever subset it has; observers ignore zero values.