From 446857e0ccdae81e5834e9223c21aaa791fd3b90 Mon Sep 17 00:00:00 2001 From: Joshua Rich Date: Tue, 29 Oct 2024 18:39:57 +1000 Subject: [PATCH] feat(agent): :sparkles: add an interface to represent a worker with preferences for future use --- internal/agent/workers.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/agent/workers.go b/internal/agent/workers.go index 494d448b0..5481e7fee 100644 --- a/internal/agent/workers.go +++ b/internal/agent/workers.go @@ -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 {