You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2023/09/28 02:43:46 UTC
[GitHub] [incubator-opendal] Xuanwo commented on a diff in pull request #3198: feat(bindings/python): Enable `BlockLayer` for on-blocking services that don't support blocking
Xuanwo commented on code in PR #3198:
URL: https://github.com/apache/incubator-opendal/pull/3198#discussion_r1339449945
##########
bindings/python/src/lib.rs:
##########
@@ -63,8 +63,12 @@ fn build_operator(
scheme: od::Scheme,
map: HashMap<String, String>,
layers: Vec<layers::Layer>,
+ blocking: bool,
) -> PyResult<od::Operator> {
- let op = od::Operator::via_map(scheme, map).map_err(format_pyerr)?;
+ let mut op = od::Operator::via_map(scheme, map).map_err(format_pyerr)?;
+ if blocking && !op.info().full_capability().blocking {
+ op = op.layer(od::layers::BlockingLayer::create().expect("blocking layer must be created"));
Review Comment:
Please call `Handle::enter()` before calling BlockingLayer::create()
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org