|
|
@ -13,7 +13,6 @@ type StreamLoader struct { |
|
|
|
cur *mongox.Cursor |
|
|
|
cur *mongox.Cursor |
|
|
|
query *query.Query |
|
|
|
query *query.Query |
|
|
|
ctx context.Context |
|
|
|
ctx context.Context |
|
|
|
ref interface{} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// DecodeNextMsg decodes the next document to an interface or returns an error
|
|
|
|
// DecodeNextMsg decodes the next document to an interface or returns an error
|
|
|
@ -80,7 +79,7 @@ func (l *StreamLoader) Cursor() (cursor *mongox.Cursor) { |
|
|
|
func (l *StreamLoader) Close() (err error) { |
|
|
|
func (l *StreamLoader) Close() (err error) { |
|
|
|
|
|
|
|
|
|
|
|
closerr := l.cur.Close(l.ctx) |
|
|
|
closerr := l.cur.Close(l.ctx) |
|
|
|
invokerr := l.query.OnClose().Invoke(l.ctx, l.ref) |
|
|
|
invokerr := l.query.OnClose().Invoke(l.ctx, nil) |
|
|
|
|
|
|
|
|
|
|
|
if closerr != nil { |
|
|
|
if closerr != nil { |
|
|
|
err = closerr |
|
|
|
err = closerr |
|
|
|