Process the upload event, generating ndjson updates. Yields: Each state update as JSON followed by a new line.
()
| 1021 | ) |
| 1022 | |
| 1023 | async def _ndjson_updates(): |
| 1024 | """Process the upload event, generating ndjson updates. |
| 1025 | |
| 1026 | Yields: |
| 1027 | Each state update as JSON followed by a new line. |
| 1028 | """ |
| 1029 | # Process the event. |
| 1030 | async with app.state_manager.modify_state(token) as state: |
| 1031 | async for update in state._process(event): |
| 1032 | # Postprocess the event. |
| 1033 | update = await app.postprocess(state, event, update) |
| 1034 | yield update.json() + "\n" |
| 1035 | |
| 1036 | # Stream updates to client |
| 1037 | return StreamingResponse( |
no test coverage detected