Update documentation in runtime package regarding PushFunc

This commit is contained in:
Patrick Pacher 2020-10-07 09:02:54 +02:00
parent 4756896d32
commit a3bceeabcf
No known key found for this signature in database
GPG key ID: E8CD2DA160925A6D
2 changed files with 4 additions and 2 deletions

View file

@ -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

View file

@ -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}