func (t *removeTask) Do(repo watchdb.WatchProvider) (err error) { var removed bool if t.id == FLUSH_DB { repo.Clear() removed = true } else if ok := repo.Remove(t.id); ok { removed = true } t.ch <- removed return }
func (t *createTask) Do(repo watchdb.WatchProvider) (err error) { id, _ := repo.Add(t.w) t.ch <- &createTaskResponse{id, t.w.Tag} return }
func (t *statusTask) Do(repo watchdb.WatchProvider) (err error) { size := repo.Size() t.ch <- &status{size} return }
func (t *matchTask) Do(repo watchdb.WatchProvider) (err error) { m, _ := repo.Match(t.expr) t.ch <- m return }