Skip to content

Possibility of replacing tornado coroutines with native coroutines. #555

@rahulporuri

Description

@rahulporuri

Now that Python < 3.5 is not supported, the ipykernel project should be able to move away from the use of tornado coroutines to native async/await coroutines.

Is this on the radar for the project or is this not feasible? If this is in fact possible, is this planned for the short term and/or is anyone on the team working on this refactor?

As far as I can understand, the changes will essentially be updating tordano.gen.coroutine to async def functions and replace yield gen.future(...) statements in the coroutines with await .... It looks like the codebase also uses tornado.gen.sleep which can be replaced with asyncio.sleep. Please correct me if I am missing something non-trivial?

Note that I am not advocating for the removal of the dependence on tordano - simply the use of native coroutines over tornado coroutines.

Ref : https://github.com/tornadoweb/tornado/blob/5913aa43ecfdaa76876fc57867062227b907b1dd/tornado/gen.py#L5-L13 - for comment in the tornado.gen module regarding tornado coroutines and native async/await coroutines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions