Finish database queries and subscriptions / Improve Accessor

This commit is contained in:
Daniel 2018-09-27 15:56:35 +02:00
parent 8c861a1e4f
commit 9ab95b1926
17 changed files with 235 additions and 33 deletions

View file

@ -6,9 +6,9 @@ import (
// Iterator defines the iterator structure.
type Iterator struct {
Next chan record.Record
Done chan struct{}
Error error
Next chan record.Record
Done chan struct{}
Err error
}
// New creates a new Iterator.
@ -18,3 +18,9 @@ func New() *Iterator {
Done: make(chan struct{}),
}
}
func (it *Iterator) Finish(err error) {
close(it.Next)
close(it.Done)
it.Err = err
}