Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-96939

Improve ReactorTimer documentation

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Networking & Observability
    • Fully Compatible
    • Networking & Obs 2024-11-11, Networking & Obs 2024-11-25

      The ReactorTimer only allows one outstanding Future at a time, and will cancel the outstanding Future if waitUntil is called again.
       
      This comment on waitUntil makes this fairly clear:

       /* 
        * Returns a future that will be filled with Status::OK after the deadline has passed. 
        * 
        * Calling this implicitly calls cancel(). 
      */ 
      virtual Future<void> waitUntil(Date_t deadline, const BatonHandle& baton = nullptr) = 0;

      but then the comment on the destructor mentions a plural Futures:

      /* 
       * The destructor calls cancel() to ensure outstanding Futures are filled.   */ 
      virtual ~ReactorTimer() = default;

      It would be nice to make it very explicit that there can only be one outstanding Future at a time on the ReactorTimer, and remove the reference to plural Futures from the destructor docstring.

            Assignee:
            erin.mcnulty@mongodb.com Erin McNulty
            Reporter:
            erin.mcnulty@mongodb.com Erin McNulty
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: