Do not rewind command cursor in ChangeStream constructor

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 1.3.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Once PHPC-1050 is resolved, we should ensure that the ChangeStream iterator does not rewind its internal command cursor upon construction. The initial rewind will likely advance the cursor and check for an error, which is prone to issuing a getMore command if the first batch is empty (as it typically will be for new change streams). That getMore incurs an unexpected delay (one second by default), which would happen during the call to Collection::watch().

      If we instead rely on users to invoke ChangeStream::rewind() when they begin iteration, we can defer that initial getMore to the beginning of iteration.

            Assignee:
            Katherine Walker (Inactive)
            Reporter:
            Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: