mirror of
https://github.com/safing/portbase
synced 2025-09-01 10:09:50 +00:00
Update documentation in runtime package regarding PushFunc
This commit is contained in:
parent
4756896d32
commit
a3bceeabcf
2 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Add table
Reference in a new issue