Skip to content

Commit 5939dbf

Browse files
committed
PYTHON-5676 Phase 3: Unify run_operation() with network.command()
Extract _network_command_core() from network.command() to handle the common send/receive/APM/decrypt pipeline. Both the standard command path and the cursor (find/getMore) path now use the same core function. - New _network_command_core() in network.py: takes a pre-built message and handles APM, send_message, receive_message, unpack, process, check, decrypt — returns (docs, reply, duration) - command() is now a thin wrapper: encode → _network_command_core → return docs[0] - run_operation() is now a thin wrapper: build message → _network_command_core → wrap in Response/PinnedResponse - _CURSOR_DOC_FIELDS moved from server.py to network.py (only used in core) - server.py drops _decode_all_selective, _check_command_response, _convert_exception, NotPrimaryError, OperationFailure imports
1 parent 4e6a0fe commit 5939dbf

5 files changed

Lines changed: 424 additions & 607 deletions

File tree

PYTHON-5676-scope.md

Lines changed: 0 additions & 183 deletions
This file was deleted.

0 commit comments

Comments
 (0)