Documentation ¶
Overview ¶
Package updater provides the ability for concurrently running demo pieces to update a shared json object.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SetFunc ¶
type SetFunc func(v interface{})
SetFunc serializes the value passed in into json and sets the associated field to that value. If nil is passed (BUT NOT a nil value of an interface), the field will be removed from the Updater's json object.
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater is like a json object, with each field allowed to be updated concurrently by a different process. After processing updates, Updater will call a provided method with the json serialized value of all of its fields.
func New ¶
New creates an Updater. Set is called when fields update, using the json serialized value of Updater's tree. All updates after ctx is canceled are ignored.