Skip to content

Commit

Permalink
chore: more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Dec 22, 2023
1 parent 9e23bb6 commit d05f21c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions util/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/evcc-io/evcc/api"
)

// Monitor monitors values for regular updates
type Monitor[T any] struct {
val T
mu sync.RWMutex
Expand All @@ -16,6 +17,7 @@ type Monitor[T any] struct {
timeout time.Duration
}

// NewMonitor created a new monitor with given timeout
func NewMonitor[T any](timeout time.Duration) *Monitor[T] {
return &Monitor[T]{
done: make(chan struct{}),
Expand Down

0 comments on commit d05f21c

Please sign in to comment.