Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2899

Server selector constructors should not return interfaces

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • 2.1.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      The server selectors in the Go Driver return the "ServerSelector" interface:

      • CompositeSelector
      • LatencySelector
      • WriteSelector
      • ReadPrefSelector

      They should each be updated to return a struct that consumes a ServerSelectionFunc and any other information that is required to perform a server selection.

      Rationale: Preempting the interface is not really necessary in any of these cases and makes the code fairly confusing.

            Assignee:
            Unassigned Unassigned
            Reporter:
            preston.vasquez@mongodb.com Preston Vasquez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: