[CXX-1288] Add method to detect dead tailable cursor Created: 27/Mar/17 Updated: 24/May/17 Resolved: 24/May/17 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | API |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | David Golden | Assignee: | Samuel Rossi (Inactive) |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
Currently, users have no way of knowing that a tailable cursor is "dead" – i.e. that there are no more documents to iterate and the server has returned a cursor_id of zero. After |
| Comments |
| Comment by Samuel Rossi (Inactive) [ 24/May/17 ] | ||||||||||
|
From investigating this, it seems that mongoc_get_more will only return false in the case of an error (because the server will never return a cursor id of 0 for a tailable cursor). Because of this, there isn't any need for this method. | ||||||||||
| Comment by J Rassi [ 14/Apr/17 ] | ||||||||||
|
As an alternative to adding a new method, we can also consider it exceptional behavior for the server to close a tailable cursor. Users would be able to detect this via try/catch. | ||||||||||
| Comment by David Golden [ 27/Mar/17 ] | ||||||||||
|
We also need to update the tailable cursor example. A possible way this might be used:
|