pre-commit-ci-lite[bot]
8c6866cfd4
🎨 Auto format
5 months ago
Akash Wankhede
543d62a5fa
Fix issue: Title: StreamingResponse doc example needs correction
Body:
[`StreamingResponse` docs](https://fastapi.tiangolo.com/advanced/custom-response/?h=responses#streamingresponse ) state:
> Takes an async generator or a normal generator/iterator
However based on https://github.com/Kludex/starlette/discussions/1776#discussioncomment-3207518 `async` generetors need something `await`ed to work:
```py
import asyncio
from time import sleep
from fastapi import FastAPI
from fastapi.responses import StreamingResponse
app = FastAPI()
async def fake_video_streamer():
for i in range(10):
sleep(0.1)
yield b"some fake video bytes"
# await asyncio.sleep(0) # <-- uncomment to fix example
@app.get("/")
async def main():
"""
this is as per
https://fastapi.tiangolo.com/advanced/custom-response/?h=responses#streamingresponse
but does not to work (blocks for 1 sec, then returns all chunks at once):
curl -sNo- localhost:8000
wget -qO- localhost:8000
"""
return StreamingResponse(fake_video_streamer())
```
- `uvicorn==0.40.0`
- `fastapi==0.128.0`
--- Comments ---
User: casperdcl
It seems based on https://github.com/Kludex/starlette/discussions/1776#discussioncomment-3207518 that `await asyncio.sleep(0)` needs to be added to the documented example to work.
User: mirza-mohibul-hasan
Hi @casperdcl , thanks for raising this. I understand the issue and the root cause with async generators blocking without an await. If the fix isn’t already finalized, I’d be happy to work on this or help refine the docs/validate the example. Please let me know if that works for you.
User: casperdcl
fixed in #14681
5 months ago
Sebastián Ramírez
36985f5f25
🔖 Release version 0.128.3
5 months ago
github-actions[bot]
661cdfb8a4
📝 Update release notes
[skip ci]
5 months ago
github-actions[bot]
201feedd68
📝 Update release notes
[skip ci]
5 months ago
github-actions[bot]
01e85c03bd
📝 Update release notes
[skip ci]
5 months ago
Sebastián Ramírez
08233d7ffc
🌐 Update translations for ru (update-outdated) ( #14834 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
5 months ago
github-actions[bot]
fe8c33ea64
📝 Update release notes
[skip ci]
5 months ago
github-actions[bot]
8e50c55fd9
📝 Update release notes
[skip ci]
5 months ago
Sebastián Ramírez
79406a4b04
🔖 Release version 0.128.2
5 months ago
github-actions[bot]
de56c96c64
📝 Update release notes
[skip ci]
5 months ago
Sebastián Ramírez
570e592a03
🌐 Enable Traditional Chinese translations ( #14842 )
5 months ago
github-actions[bot]
110b45d9b2
📝 Update release notes
[skip ci]
5 months ago
Sebastián Ramírez
72325f698f
🌐 Enable French docs translations ( #14841 )
5 months ago
github-actions[bot]
8bdbd3725f
📝 Update release notes
[skip ci]
5 months ago
github-actions[bot]
6646e2b94f
📝 Update release notes
[skip ci]
5 months ago
github-actions[bot]
54f8aeeb9a
📝 Update release notes
[skip ci]
5 months ago
github-actions[bot]
0dd42b746e
📝 Update release notes
[skip ci]
5 months ago
github-actions[bot]
464c359bb0
📝 Update release notes
[skip ci]
5 months ago
Sebastián Ramírez
457cd75c23
🌐 Update translations for fr (translate-page) ( #14837 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
5 months ago
github-actions[bot]
2838dcb4a8
📝 Update release notes
[skip ci]
5 months ago
github-actions[bot]
b82993643e
📝 Update release notes
[skip ci]
5 months ago
Sebastián Ramírez
b892c3126c
🌐 Update translations for de (update-outdated) ( #14836 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
5 months ago
github-actions[bot]
3578270af4
📝 Update release notes
[skip ci]
5 months ago
Sebastián Ramírez
2224b4e63b
🌐 Update translations for pt (update-outdated) ( #14833 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
5 months ago
Sebastián Ramírez
136d5f0a56
🌐 Update translations for ko (update-outdated) ( #14835 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
5 months ago
github-actions[bot]
afb44f0ff8
📝 Update release notes
[skip ci]
5 months ago
Sebastián Ramírez
4fe06cc24a
🌐 Update translations for es (update-outdated) ( #14832 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
5 months ago
github-actions[bot]
cae2659678
📝 Update release notes
[skip ci]
5 months ago
Sebastián Ramírez
da9e101d50
🌐 Update translations for tr (update-outdated) ( #14831 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
5 months ago
github-actions[bot]
8488d31aff
📝 Update release notes
[skip ci]
5 months ago
Sebastián Ramírez
dcfd432c36
📝 Update docs for translations ( #14830 )
5 months ago
github-actions[bot]
c7682a198a
📝 Update release notes
[skip ci]
5 months ago
Sebastián Ramírez
b5d276bda8
🌐 Update translations for tr (add-missing) ( #14790 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
5 months ago
github-actions[bot]
2c5a844c44
📝 Update release notes
[skip ci]
5 months ago
Sebastián Ramírez
6ff8ff5b57
🌐 Update translations for fr (update-outdated) ( #14826 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
5 months ago
github-actions[bot]
f23ea3bd95
📝 Update release notes
[skip ci]
5 months ago
Sebastián Ramírez
b4ed7e5b06
🌐 Update translations for zh-hant (update-outdated) ( #14825 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
5 months ago
github-actions[bot]
c00cebc5c6
📝 Update release notes
[skip ci]
5 months ago
Sebastián Ramírez
31faba8e41
🌐 Update translations for uk (update-outdated) ( #14822 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Motov Yurii <[email protected] >
Co-authored-by: Maksym Zavalniuk <[email protected] >
Co-authored-by: Roman Mashevskyi <[email protected] >
5 months ago
github-actions[bot]
64d0ee9104
📝 Update release notes
[skip ci]
5 months ago
Rayyan oumlil
2e170b9585
📝 Fix duplicate word in `advanced-dependencies.md` ( #14815 )
5 months ago
github-actions[bot]
5ca11c59e3
📝 Update release notes
[skip ci]
5 months ago
Sebastián Ramírez
0e68d36cd5
🔨 Update docs and translations scripts, enable Turkish ( #14824 )
5 months ago
Sebastián Ramírez
1de0de56c8
🔖 Release version 0.128.1
5 months ago
github-actions[bot]
734c95b05a
📝 Update release notes
[skip ci]
5 months ago
github-actions[bot]
0e064009fb
📝 Update release notes
[skip ci]
5 months ago
Roman Mashevskyi
ad29e44c81
🌐 Improve LLM prompt of `uk` documentation ( #14795 )
5 months ago
github-actions[bot]
71ceac20da
📝 Update release notes
[skip ci]
5 months ago
Sebastián Ramírez
b0e99d66e8
🌐 Update translations for ja (update-outdated) ( #14588 )
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yurii Motov <[email protected] >
Co-authored-by: Motov Yurii <[email protected] >
Co-authored-by: Maruo.S <[email protected] >
5 months ago