Exemple #1
0
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
}
Exemple #2
0
func (t *createTask) Do(repo watchdb.WatchProvider) (err error) {
	id, _ := repo.Add(t.w)
	t.ch <- &createTaskResponse{id, t.w.Tag}
	return
}
Exemple #3
0
func (t *statusTask) Do(repo watchdb.WatchProvider) (err error) {
	size := repo.Size()
	t.ch <- &status{size}
	return
}
Exemple #4
0
func (t *matchTask) Do(repo watchdb.WatchProvider) (err error) {
	m, _ := repo.Match(t.expr)
	t.ch <- m
	return
}