Avoid copy in Future::tapAll

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Server Programmability
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      The implementation for Future::tapAll currently constructs a StatusWith<T> using T's copy constructor, which it then passes to the provided callback. This is potentially wasteful, as tapAll callbacks often do not require ownership of the result. Furthermore, this prevents one from registering a tapAll callback on a Future whose result type is non-copyable.

      If possible, we should relax this constraint on Future::tapAll.

            Assignee:
            Unassigned
            Reporter:
            Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: