Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bindings/java/src/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ pub extern "system" fn Java_org_apache_opendal_layer_ConcurrentLimitLayer_doLaye
permits: jlong,
) -> jlong {
let op = unsafe { &*op };
let concurrent_limit = ConcurrentLimitLayer::new(permits as usize);
let concurrent_limit = ConcurrentLimitLayer::with_permits(permits as usize);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to this change this API.

Box::into_raw(Box::new(op.clone().layer(concurrent_limit))) as jlong
}
2 changes: 1 addition & 1 deletion bindings/nodejs/src/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ impl ConcurrentLimitLayer {
#[napi]
pub fn build(&self) -> External<Layer> {
let permits = self.permits;
let mut l = opendal::layers::ConcurrentLimitLayer::new(permits as usize);
let mut l = opendal::layers::ConcurrentLimitLayer::with_permits(permits as usize);

if let Some(http_permits) = self.http_permits {
l = l.with_http_concurrent_limit(http_permits as usize);
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/src/layers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl ConcurrentLimitLayer {
#[new]
#[pyo3(signature = (limit))]
fn new(limit: usize) -> PyResult<PyClassInitializer<Self>> {
let concurrent_limit = Self(ocore::layers::ConcurrentLimitLayer::new(limit));
let concurrent_limit = Self(ocore::layers::ConcurrentLimitLayer::with_permits(limit));
let class = PyClassInitializer::from(Layer(Box::new(concurrent_limit.clone())))
.add_subclass(concurrent_limit);

Expand Down
2 changes: 1 addition & 1 deletion bindings/ruby/src/middlewares.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ struct ConcurrentLimitMiddleware(Arc<Mutex<ocore::layers::ConcurrentLimitLayer>>
impl ConcurrentLimitMiddleware {
fn new(permits: usize) -> Self {
Self(Arc::new(Mutex::new(
ocore::layers::ConcurrentLimitLayer::new(permits),
ocore::layers::ConcurrentLimitLayer::with_permits(permits),
)))
}

Expand Down
Loading
Loading