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

Implement Convenient API for Transactions

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.1
    • Affects Version/s: None
    • Component/s: None
    • None

      See DRIVERS-556 for details.

      See also this comment thread with Jesse:
      https://github.com/mongodb/mongo-python-driver/pull/411#discussion_r263559402

      Motor should accept a coroutine as a callback, wrap that in another callback which schedules the coroutine on the event loop and waits (blocking this thread) until the coroutine finishes, then passes back its return value or reraises its exception, unblocking this thread.

      Once it's wrapped the coroutine in the wrapper callback, Motor will do its usual thing: schedule PyMongo's with_transaction() on the Motor thread pool and return a Future that's resolved when with_transaction() finishes.

            Assignee:
            prashant.mital Prashant Mital (Inactive)
            Reporter:
            rathi.gnanasekaran Rathi Gnanasekaran
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: