Jump to content
彼岸论坛
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[Cloudflare] cf worker Python 的问题,到底是否要 async?


Recommended Posts

Posted
他们文档的例子是不带 async 的
from js import Response

def on_fetch(request):
return Response.new("Hello World!")

但如果我要访问 request 对象,因为 request 对象是 awaitable 的,那我的 on_fetch 函数也
需要加 async

我的提问是:他们怎么做到同时兼容带有和不带 async 的两种不同的 on_fetch 的?
  • 游客注册

    游客注册

  • Members

    No members to show

  • Recent Status Updates

    No Recent Status Updates
  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...