diff --git a/runtime/provider.go b/runtime/provider.go index 806ac84..8ddf583 100644 --- a/runtime/provider.go +++ b/runtime/provider.go @@ -18,7 +18,9 @@ var ( type ( // PushFunc is returned when registering a new value provider // and can be used to inform the database system about the - // availability of a new runtime record value. + // availability of a new runtime record value. Similar to + // database.Controller.PushUpdate, the caller must hold + // the lock for each record passed to PushFunc. PushFunc func(...record.Record) // ValueProvider provides access to a runtime-computed diff --git a/runtime/singe_record_provider.go b/runtime/singe_record_provider.go index 7619f28..0688cb4 100644 --- a/runtime/singe_record_provider.go +++ b/runtime/singe_record_provider.go @@ -23,8 +23,8 @@ type singleRecordReader struct { // pushUpdate, _ := runtime.Register("my/key", ProvideRecord(r)) // r.Lock() // r.Value = "foobar" -// r.Unlock() // pushUpdate(r) +// r.Unlock() // func ProvideRecord(r record.Record) ValueProvider { return &singleRecordReader{r}