Skip to content

Commit

Permalink
remove limit from http connector (makes no sense)
Browse files Browse the repository at this point in the history
  • Loading branch information
glendc committed Nov 21, 2023
1 parent 62756da commit 2bffa62
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
1 change: 0 additions & 1 deletion rama/examples/tokio_tcp_http_hello.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ where
.compression()
.trace()
.timeout(Duration::from_secs(10))
.limit(ConcurrentPolicy::new(1))
.serve::<WebServer, _, _, _>(self.web_server.clone())
.await;
if let Err(err) = result {
Expand Down
20 changes: 1 addition & 19 deletions rama/src/server/tcp/http/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,25 +139,6 @@ impl<B, S, L> HttpConnector<B, S, L> {
service_builder: self.service_builder.filter_async(predicate),
}
}

/// Limit the number of in-flight requests.
///
/// This wraps the inner service with an instance of the [`Limit`]
/// middleware. The `policy` determines how to handle requests sent
/// to the inner service when the limit has been reached.
///
/// [`Limit`]: crate::service::limit::Limit
pub fn limit<P>(
self,
policy: P,
) -> HttpConnector<B, S, crate::service::util::Stack<crate::service::limit::LimitLayer<P>, L>>
{
HttpConnector {
builder: self.builder,
stream: self.stream,
service_builder: self.service_builder.limit(policy),
}
}
}

impl<B, S, L> HttpConnector<B, S, L> {
Expand Down Expand Up @@ -328,6 +309,7 @@ impl<B, S, L> HttpConnector<B, S, L> {
///
/// [`tower_http::trace`]: crate::service::http::trace
/// [`TraceLayer`]: crate::service::http::trace::TraceLayer
#[allow(clippy::type_complexity)]
pub fn trace_layer<M, MakeSpan, OnRequest, OnResponse, OnBodyChunk, OnEos, OnFailure>(
self,
layer: crate::service::http::trace::TraceLayer<
Expand Down

0 comments on commit 2bffa62

Please sign in to comment.