Documentation
¶
Overview ¶
Package events provides real-time event streaming for task lifecycle events
Package events provides real-time event streaming for task lifecycle events
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatEvent ¶
FormatEvent formats an event for JSONL output
func FormatEventCompact ¶
FormatEventCompact formats an event in a compact human-readable format
Types ¶
type Bus ¶
type Bus struct {
// contains filtered or unexported fields
}
Bus manages event streaming and subscription
func (*Bus) SubscriberCount ¶
SubscriberCount returns the number of active subscribers
func (*Bus) Unsubscribe ¶
Unsubscribe removes a subscription channel
type Event ¶
type Event struct {
ID string `json:"id" db:"id"`
Type EventType `json:"type" db:"type"`
Timestamp int64 `json:"timestamp" db:"timestamp"`
TaskID string `json:"task_id" db:"task_id"`
EpicID string `json:"epic_id,omitempty" db:"epic_id"`
Data map[string]any `json:"data,omitempty" db:"data"` // JSON encoded
}
Event represents a single task lifecycle event
func (*Event) MarshalData ¶
MarshalData converts the Data map to JSON for storage
func (*Event) UnmarshalData ¶
UnmarshalData parses JSON data into the Data map
type EventFilter ¶
type EventFilter struct {
Types []EventType `json:"types,omitempty"`
EpicID string `json:"epic_id,omitempty"`
TaskID string `json:"task_id,omitempty"`
Since int64 `json:"since,omitempty"` // Unix timestamp
Until int64 `json:"until,omitempty"` // Unix timestamp
Limit int `json:"limit,omitempty"` // Max events to return
Follow bool `json:"follow,omitempty"` // Whether to follow new events (streaming mode)
}
EventFilter defines filters for querying events
type EventType ¶
type EventType string
EventType represents the type of event
const ( // EventTaskStarted is emitted when a task begins execution EventTaskStarted EventType = "task.started" // EventTaskCompleted is emitted when a task completes successfully EventTaskCompleted EventType = "task.completed" // EventTaskFailed is emitted when a task fails EventTaskFailed EventType = "task.failed" // EventTaskBlocked is emitted when a task is blocked by dependencies EventTaskBlocked EventType = "task.blocked" // EventTaskUnblocked is emitted when a blocked task's dependencies are resolved EventTaskUnblocked EventType = "task.unblocked" // EventTaskCancelled is emitted when a task is cancelled EventTaskCancelled EventType = "task.cancelled" // EventTaskClaimed is emitted when a worker claims a task EventTaskClaimed EventType = "task.claimed" // EventTaskPaused is emitted when a task is paused EventTaskPaused EventType = "task.paused" // EventTaskResumed is emitted when a paused task is resumed EventTaskResumed EventType = "task.resumed" )
type StreamOptions ¶
type StreamOptions struct {
Filter EventFilter
JSONLines bool // Output in JSONL format (one JSON object per line)
Quiet bool // Suppress non-event messages
}
StreamOptions configures the event stream
type Streamer ¶
type Streamer struct {
// contains filtered or unexported fields
}
Streamer handles streaming events to clients
func NewStreamer ¶
func NewStreamer(bus *Bus, filter EventFilter) *Streamer
NewStreamer creates a new event streamer with the given filter