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

Separate command.Command into command.Read and command.Write

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 0.0.9
    • Affects Version/s: 0.0.8
    • Component/s: Command & Dispatch
    • Labels:
      None

      Currently command.Command is used as the base level command to send to a server. During the implementation of OP_MSG additional properties were added to command.Command that make it much more difficult to use, mainly the Acknowledged property which should default to true.

      Additionally, the command package will eventually be used as a proxy or server implementation, which means it needs to be able to decode driver requests. The current command.Command can handle this but has no path to transform into another command type, such as command.Insert. When the proxy and server components of the networking library are created, there will be a need for a new type that can handle this decode path.

      To enable a more usable command package and to make space for the networking library improvement split command.Command into command.Read and command.Write. The command.Read type will take the *readpref.ReadPref property from command.Command and the command.Write type will have a *writeconcern.WriteConcern property.

      Further, the mongo package should handle extracting the *writeconcern.WriteConcern option and the *readpref.ReadPref and attaching them to the correct command type.

      In the future, when the networking library's proxy and server components are being developed, the command.Command type can be recreated to handle the functionality described above.

            Assignee:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Reporter:
            kris.brandow@mongodb.com Kristofer Brandow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: