MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / receive_message

Method receive_message

pymongo/asynchronous/pool.py:450–459  ·  view source on GitHub ↗

Receive a raw BSON message or raise ConnectionFailure. If any exception is raised, the socket is closed.

(self, request_id: Optional[int])

Source from the content-addressed store, hash-verified

448 await self._raise_connection_failure(error)
449
450 async def receive_message(self, request_id: Optional[int]) -> Union[_OpReply, _OpMsg]:
451 """Receive a raw BSON message or raise ConnectionFailure.
452
453 If any exception is raised, the socket is closed.
454 """
455 try:
456 return await async_receive_message(self, request_id, self.max_message_size)
457 # Catch KeyboardInterrupt, CancelledError, etc. and cleanup.
458 except BaseException as error:
459 await self._raise_connection_failure(error)
460
461 def _raise_if_not_writable(self, unacknowledged: bool) -> None:
462 """Raise NotPrimaryError on unacknowledged write if this socket is not

Callers 3

_next_replyMethod · 0.95
write_commandMethod · 0.95
run_operationMethod · 0.45

Calls 2

async_receive_messageFunction · 0.90

Tested by

no test coverage detected