async def METHOD_NAME(app: web.Application) -> AsyncGenerator[None, None]:
    # add components to state
    app[
        APP_LONG_RUNNING_TASKS_MANAGER_KEY
    ] = long_running_task_manager = TasksManager(
        stale_task_check_interval_s=stale_task_check_interval_s,
        stale_task_detect_timeout_s=stale_task_detect_timeout_s,
    )
    # add error handlers
    app.middlewares.append(base_long_running_error_handler)
    yield
    # cleanup
    await long_running_task_manager.close()