How to interface blocking and non-blocking code with asyncio

后端 未结 2 1932
名媛妹妹
名媛妹妹 2021-01-12 11:52

I\'m trying to use a coroutine function outside of the event loop. (In this case, I want to call a function in Django that could also be used inside the event loop too)

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-12 12:20

    About case #2: Blocking code should be at least wrapped with .run_in_executor.

提交回复
热议问题