Code Explainers

Code explainers tagged #async-generators

python
import asyncio
import json
 
from fastapi import APIRouter, Depends, HTTPException

Streaming export progress with SSE in FastAPI

server-sent-events async-generators streaming
Advanced 8 steps
rust
use axum::{
    extract::State,
    response::sse::{Event, KeepAlive, Sse},
    Json,

Proxying an SSE chat stream in Axum

server-sent-events streaming async-generators
Advanced 10 steps
typescript
interface Page<T> {
  items: T[];
  nextCursor: string | null;
}

Streaming cursor pagination with async generators

async-generators pagination generics
Intermediate 8 steps
python
import csv
import io
from datetime import date
 

Streaming a CSV export in FastAPI

streaming async-generators csv
Advanced 8 steps