Uploaded image for project: 'Motor'
  1. Motor
  2. MOTOR-1165

Add documentation for CSOT

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 3.6
    • Affects Version/s: None
    • Component/s: None
    • None

      CSOT already works in motor as documented in pymongo: https://pymongo.readthedocs.io/en/latest/examples/timeouts.html#pymongo-timeout-is-asyncio-safe

      timeout() is asyncio safe; the timeout only applies to current Task and multiple Tasks can configure different timeouts concurrently. timeout() can be used identically in Motor, for example:

      import motor.motor_asyncio
      client = motor.motor_asyncio.AsyncIOMotorClient()
      coll = client.test.test
      with pymongo.timeout(10):
          await coll.insert_one({"name": "Nunu"})
          await coll.find_one({"name": "Nunu"})
      

      However we probably want to add documentation examples in motor itself.

            Assignee:
            steve.silvester@mongodb.com Steve Silvester
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: