The assigner, grants and the indexer ask their views again when the bus makes their consumer after a first view (issue 1966, recovery) #184
@@ -200,6 +200,12 @@ func (iv *indexerViews) start(ctx context.Context, w *world, wake func(), settle
|
||||
}
|
||||
})
|
||||
}
|
||||
// The hub says when the bus made its consumer: a picture asked before then is asked again (views.Follower.ConsumerMade).
|
||||
iv.hub.OnBound(func(created time.Time) {
|
||||
for _, f := range all {
|
||||
f.ConsumerMade(ctx, created)
|
||||
}
|
||||
})
|
||||
// Not heard, the indexer's views family is the finding family-not-heard until it binds (ADR 0615 §5): the handler is
|
||||
// registered on the module's hub, which the assigner starts once every handler is.
|
||||
_ = notHeardWriter(iv.findings, iv.logf).Bind(process.EventsStream, "the indexer's manifests, modules and graph are the first views' alone until the assigner starts again", func() error {
|
||||
|
||||
@@ -166,6 +166,8 @@ func followAssignments(ctx context.Context, hub *process.EventHub, cred process.
|
||||
}()
|
||||
// The assigner's views family, on the module's one hub (the host starts it once every handler is registered); a family the
|
||||
// hub cannot register is the finding family-not-heard until the indexer starts again (ADR 0615 §5).
|
||||
// The hub says when the bus made its consumer: a picture asked before then is asked again (views.Follower.ConsumerMade).
|
||||
hub.OnBound(func(created time.Time) { f.ConsumerMade(ctx, created) })
|
||||
_ = notHeardWriter(ctx, findings, logf).Bind(process.EventsStream, "the assignments is the first view's alone, asked again by hand, until the indexer starts again", func() error {
|
||||
return hub.Handle("mesh.mod."+index.AssignerModule+".event."+views.EventPrefix+"*", views.Hear(ctx, map[string]*views.Follower{index.AssignmentsState: f}, logf))
|
||||
})
|
||||
|
||||
@@ -158,6 +158,12 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro
|
||||
if !registered {
|
||||
registered = true
|
||||
// An owner's views event goes to the follower of its state, which acknowledges it (firstviews.go).
|
||||
// The hub says when the bus made its consumer: a picture asked before then is asked again (views.Follower.ConsumerMade).
|
||||
hub.OnBound(func(created time.Time) {
|
||||
for _, f := range byState {
|
||||
f.ConsumerMade(ctx, created)
|
||||
}
|
||||
})
|
||||
if err := hub.Handle(views.EventsPattern, hearViews); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user