feat(parquet): add async support for wasm targets #8460
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
AsyncFileWriter
doesn't need to beSend
#7612.Rationale for this change
This PR introduces
BoxedFuture
type alias to replacefutures::future::BoxFuture
.It helps building on WebAssembly targets (e.g.
wasm32-unknown-unknown
,wasm32-wasip2
).The original codes are driven from: https://github.com/apache/opendal/blob/37efe24235388788b892f46e4101d59ecd37918c/core/src/raw/futures_util.rs#L43-L58
I think it's not an ultimate solution, because the API rework is in progress.
But I think it's useful for now.
What changes are included in this PR?
futures::future::BoxFuture
intoBoxedFuture
for WASM targets, which is thread-local.FutureExt::boxed
calls intoBox::pin
to catchSend
automaticallyAre these changes tested?
All build steps below are passed on my local machine:
cargo build --package parquet --target wasm32-unknown-unknown -p parquet --features async
cargo build --package parquet --target wasm32-wasip1 -p parquet --features async
cargo build --package parquet --target wasm32-wasip2 -p parquet --features async
The tests are not passed because:
wasm32-unknown-unknown
:getrandom
is not supportedwasm32-wasip1
,wasm32-wasip2
:tokio/fs
is not supported yetAre there any user-facing changes?
NONE