• EnglishEspañol日本語한국어Português
  • 로그인지금 시작하기

사용자의 편의를 위해 제공되는 기계 번역입니다.

In the event of any inconsistency between the English version and the translated version, the English versionwill take priority. Please visit this page for more information.

문제 신고

sure_future(Python) 사용 시 정보 누락

문제

코루틴에서 asyncio.ensure_future 을 사용할 때 자세한 함수 추적 정보가 표시되지 않습니다.

해결책

ensure_future 에서 생성된 선물은 생성된 동일한 코루틴에서 대기해야 합니다. 예를 들어, 이전 섹션에서 awaitensure_future 와 함께 존재하지 않으므로 정보가 누락됩니다.

이전 :

import asyncio
async def foo():
ensure_future(bar())
async def bar():
await asyncio.sleep(0.5)

이후 :

import asyncio
async def foo():
await ensure_future(bar())
async def bar():
await asyncio.sleep(0.5)
Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.