Module state is hq ADR 0202: 0201 landed first for a provider's derivations
This commit is contained in:
@@ -51,7 +51,7 @@ type Registration struct {
|
||||
// code subscribes; the runtime binds the module's consumer once and calls deliver for every event,
|
||||
// acknowledging it on the bus when deliver returns nil.
|
||||
//
|
||||
// State and Watch reach the module's state (novox/hq ADR 0201): State answers `get`, `put`, `delete`
|
||||
// State and Watch reach the module's state (novox/hq ADR 0202): State answers `get`, `put`, `delete`
|
||||
// and `keys`; Watch hands deliver the current values and then every change, and returns once the
|
||||
// current values are delivered — the watch is the child's, and stops when the child does.
|
||||
type Bus interface {
|
||||
@@ -110,7 +110,7 @@ type child struct {
|
||||
next int64
|
||||
dead chan struct{}
|
||||
why error
|
||||
// watches are the state watches this child asked for, stopped when it exits (ADR 0201): a child
|
||||
// watches are the state watches this child asked for, stopped when it exits (ADR 0202): a child
|
||||
// that starts again watches again, as its code runs again.
|
||||
watches []func()
|
||||
}
|
||||
@@ -234,7 +234,7 @@ func Start(module, entry string, env []string, mesh Bus, logf func(string, ...an
|
||||
// Each change is asked of this child, in order, naming the watch it is for by
|
||||
// the id the child asked it with — two watches of one state are two handlers;
|
||||
// the watch is answered once the current values have been handed over, so a
|
||||
// bundle that awaits it has the whole of the state before it goes on (ADR 0201).
|
||||
// bundle that awaits it has the whole of the state before it goes on (ADR 0202).
|
||||
var stop func()
|
||||
watch := m.ID
|
||||
stop, err = mesh.Watch(m.Params, func(change json.RawMessage) error {
|
||||
|
||||
Reference in New Issue
Block a user