Skip to content

[BUG] pm-wasm: should not use blocking api in schedule thread #2383

@xusd320

Description

@xusd320

The tokio_fs_ext::offload::Server run in the schedule thread, a long time blocking is not desired in the thread.

pub fn gzip(&self, files: JsValue) -> Result<js_sys::Uint8Array, JsError> {

pub fn sig_md5(&self, content: &[u8]) -> String {

They should be wrapped with tokio::task::spawn_blocking, see usage example:
https://github.com/utooland/tokio-on-browser/blob/f5c7d952d372144afb9ed4ac7b916f35bfc7b2e8/src/lib.rs#L127

Metadata

Metadata

Assignees

Labels

A-Pkg ManagerArea: Package ManagerA-WasmArea WASMp0Hight Priority

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions