cmd/gopherbot: table-ify gopherbot tasks, start of daemon mode
Change-Id: I147a806c00e4c0de66b4ae490d838d7a3ac42daf
Reviewed-on: https://go-review.googlesource.com/40971
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/maintner/maintner.go b/maintner/maintner.go
index 0d3cd87..e3ac6bb 100644
--- a/maintner/maintner.go
+++ b/maintner/maintner.go
@@ -156,7 +156,9 @@
GetMutations(context.Context) <-chan *maintpb.Mutation
}
-// Initialize populates the Corpus using the data from the MutationSource.
+// Initialize populates the Corpus using the data from the
+// MutationSource. It returns once it's up-to-date. To incrementally
+// update it later, use the Update method.
func (c *Corpus) Initialize(ctx context.Context, src MutationSource) error {
ch := src.GetMutations(ctx)
done := ctx.Done()
@@ -180,6 +182,14 @@
}
}
+// Update incrementally updates the corpus from its current state to
+// the latest state from the MutationSource passed earlier to
+// Initialize. It does not return until there's either a new change or
+// the context expires.
+func (c *Corpus) Update(ctx context.Context) error {
+ panic("TODO")
+}
+
// addMutation adds a mutation to the log and immediately processes it.
func (c *Corpus) addMutation(m *maintpb.Mutation) {
if c.Verbose {