Python Workers are now generally available
Hacker News 热议:Python Workers are now generally available(156 赞 / 25 评论,来源 blog.cloudflare.com)
一句话概要
Python Workers allow developers to run Python web frameworks and AI orchestration libraries natively in the Cloudflare Workers runtime. You can seamlessly integrate with Cloudflare’s ecosystem including D1, R2, and Workers AI without writing any JavaScript glue code.
原文开头节选
We introduced Python Workers two years ago, providing a way to run Python applications in the Cloudflare Workers runtime. Our goal was to make it as simple to write Workers in Python as it is in TypeScript, and to make the ecosystem of Python packages and frameworks “just work”.
What does GA mean? It means Python is now a first-class, fully supported language on the Cloudflare Developer Platform. You can bring the Python code, libraries, and design patterns you already know and connect them seamlessly to Workers AI, R2, D1, Hyperdrive, Durable Objects, Queues, Workflows, and the rest of the Cloudflare platform. You can also run popular Python frameworks like FastAPI, Django, and Flask inside Python Workers. You can even create a Python Worker inside another Worker using Dynamic Workers .
from fastapi import FastAPI, Request from workers import asgi, WorkerEntrypoint app = FastAPI() @app.get ( ”/” ) async def root (request: Request): env = request.scope[ “env” ] return await env.
(以上为原文节选,完整内容见下方”原文来源”)
这条动态今日登上 Hacker News 首页(156 赞 / 25 评论,来源 blog.cloudflare.com)。技术雷达每日自动聚合 AI 工程、后端架构、DevOps 方向的前沿动态;相关工程落地可浏览下方的相关服务与延伸阅读,或直接与我们团队交流。
原文来源: Hacker News