Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-3288

[csot] Add pymongo.timeout() context manager API

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.2
    • Affects Version/s: None
    • Component/s: None
    • None

      For CSOT, add pymongo.timeout() context manager API:

      import pymongo
      # All blocking pymongo operations in this context combined
      # must complete within 100ms or raise a timeout exception.
      with pymongo.timeout(0.1):
          d1 = client1.db1.c1.find_one()
          d2 = client2.db2.c2.find_one()
      

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: