-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
The WireProtocol.prototype.command method is the current odd duck out in the methods provided on the wire protocol handler, in that it actually just prepares a command, rather than executing it. This is done primarily for cursors, since they build the command and save it off internally. Refactoring this method to take a command accomplishes a few things:
- Makes the API for this class consistent, allowing for easy refactoring of the actual code - or even allowing the code to be moves to another location (perhaps directly on Connection, so we can move server selection elsewhere
- Allows locations in the code that are building their own Query instances to reuse the command method, so that we can reduce the number of places we have to make wire protocol based decisions (is collation supported?)
- Once all locations in the code are using this path, we can easily switch between OP_QUERY and OP_MSG, satisfying the full implementation of OP_MSG