SetWatchErrorHandler sets an error handling function that will be called when Load operations fail during Watch
(errorFunc func(ctx context.Context, err error))
| 207 | |
| 208 | // SetWatchErrorHandler sets an error handling function that will be called when Load operations fail during Watch |
| 209 | func (l *Loader[T]) SetWatchErrorHandler(errorFunc func(ctx context.Context, err error)) *Loader[T] { |
| 210 | l.mutex.Lock() |
| 211 | defer l.mutex.Unlock() |
| 212 | l.watchErrorFunc = errorFunc |
| 213 | return l |
| 214 | } |
| 215 | |
| 216 | // SetReuseTargetStruct sets whether to reuse the same target struct or create a new one on updates |
| 217 | func (l *Loader[T]) SetReuseTargetStruct(reuse bool) *Loader[T] { |