sync vs async
Browse files
app.py
CHANGED
|
@@ -6,6 +6,10 @@ app = FastAPI()
|
|
| 6 |
async def root():
|
| 7 |
return {"message": "PGAI API"}
|
| 8 |
|
| 9 |
-
@app.get("/
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
return {"message": "haha"}
|
|
|
|
| 6 |
async def root():
|
| 7 |
return {"message": "PGAI API"}
|
| 8 |
|
| 9 |
+
@app.get("/info_sync")
|
| 10 |
+
def info_sync():
|
| 11 |
+
return {"message": "haha"}
|
| 12 |
+
|
| 13 |
+
@app.get("/info_async")
|
| 14 |
+
async def info_async():
|
| 15 |
return {"message": "haha"}
|