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

Add create_task functionality to frameworks

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

      In Motor 2.2 we support Tornado>=5 on Python>=3.5.2. Consequently, it is guaranteed that we will be using the asyncio event loop (Tornado's IOLoop wraps asyncio's event loop on Python 3.5+).
      In Python 3.5.1, the create_task function was added to asyncio's event loop which allows the scheduling of a coroutine and returns a Task object which has the same API as a Future. Using create_task we can schedule the execution of awaitable entities and get rid of manually needing to manage futures. This greatly simplifies the code by making it more modern, concise and easy to reason about.
      In order to use create_task we will need to add it to the framework API of Motor. We will also need to consider the effects of this change on forks/wrappers of Motor that might have implemented their own framework integrations.

            Assignee:
            Unassigned Unassigned
            Reporter:
            prashant.mital Prashant Mital (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: