Skip to content

Commit

Permalink
feat(agent): ✨ add an interface to represent a worker with preference…
Browse files Browse the repository at this point in the history
…s for future use
  • Loading branch information
joshuar committed Oct 29, 2024
1 parent 468f692 commit 446857e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/agent/workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ type Worker[T any] interface {
Start(ctx context.Context) (<-chan T, error)
}

// WorkerWithPreferences represents a worker that has preferences that can be
// set by a user.
type WorkerWithPreferences[T any, P any] interface {
Worker[T]
DefaultPreferences() P
}

// SensorWorker is a worker that produces sensors. In addition to the base
// worker methods, it has a function to generate a list of sensor values.
type SensorWorker interface {
Expand Down

0 comments on commit 446857e

Please sign in to comment.