diff --git a/session.go b/session.go index 5bc918730..c951e8e72 100644 --- a/session.go +++ b/session.go @@ -4265,9 +4265,11 @@ func (iter *Iter) Timeout() bool { // // Next returns true if a document was successfully unmarshalled onto result, // and false at the end of the result set or if an error happened. -// When Next returns false, the Err method should be called to verify if -// there was an error during iteration, and the Timeout method to verify if the -// false return value was caused by a timeout (no available results). +// When Next returns false, either the Err method or the Close method should be +// called to verify if there was an error during iteration. While both will +// return the error (or nil), Close will also release the cursor on the server. +// The Timeout method may also be called to verify if the false return value +// was caused by a timeout (no available results). // // For example: // @@ -4275,6 +4277,9 @@ func (iter *Iter) Timeout() bool { // for iter.Next(&result) { // fmt.Printf("Result: %v\n", result.Id) // } +// if iter.Timeout() { +// // react to timeout +// } // if err := iter.Close(); err != nil { // return err // }