Skip to content

Add async post_start method to ExtensionApp #1203

@Zsailer

Description

@Zsailer

Problem

I'm working on server extension that needs to trigger an asyncio.Task as soon as the Tornado Web Server starts. (If I try to start it any sooner, we'll get the infamous RuntimeError: no running event loop). Currently, there is no easy way to do this using the provided Server Extension API.

Proposed Solution

I'd like to propose that we add a async def post_start(...) method/API to the ExtensionApp that can be used by authors to trigger tasks after the webserver (and presumably the main event loop) is started. This works nicely with the async def stop() API that's already in-place to cleanly stop async tasks in server extensions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions