SSE Axum Backpresure on unfold() vs repeat_with().throttle()

⚓ Rust    📅 2026-01-25    👤 surdeus    👁️ 2      

surdeus

Hi,
I just coded up a axum handler that should stream the current time for learning reasons.
I endes up with two different solutions.
One with a unfold, a sleep and await of one second. And the other with repeath_with().throttle(one second)

Both worked and then (to be honest) I went and asked ChatGPT if there is any difference and it stated I must use unfold with the sleep and await for avoiding backpressure.

I think thats probably just made up and both things do the same in the end but I'm not sure.

Does anyone know if this statement about backpressure is correct?

1 post - 1 participant

Read full topic

🏷️ Rust_feed