Skip to main content

rate_limited_pieces

Function rate_limited_pieces 

Source
pub(crate) fn rate_limited_pieces<'_async0>(
    limiter: &'_async0 RateLimiter,
    chunk: StreamChunk,
) -> impl Stream<Item = StreamChunk> + '_async0
Expand description

Yield chunk under the limiter’s current policy, split into pieces no larger than the rate so that a policy update takes effect within about a second.