yewstack / prokio Goto Github PK
View Code? Open in Web Editor NEWAn asynchronous runtime compatible with WebAssembly and non-WebAssembly targets.
License: Apache License 2.0
An asynchronous runtime compatible with WebAssembly and non-WebAssembly targets.
License: Apache License 2.0
tokio
provides the following IO types:
Whilst we cannot provide these traditional IO types when running in browsers, we can provide some other IO types:
Tokio has just landed support for wasm32-wasi
.
However, wasi
misses some essential features for Yew Runtime to become useful under wasi.
wasi
can be used for:
This issue tracks the tokio features required to land wasi support for Yew Runtime:
wasi
target currently lacks networking capability in general.tokio::fs
for wasi
.This issue tracks the missing upstream support to land wasi support for Prokio Runtime with wasm-bindgen-futures backend:
wasm-bindgen
supports wasm32-wasi
.These types can be provided via the instant crate.
I'm trying to migrate an existing project from tokio to prokio for WASM support. But I't seems that unlike tokio RwLocks prokio RwLocks can not be sent across threads. Am I just doing something wrong here? Or Is there a reason for this?
Whenever I try to use one I get an error like:
future cannot be sent between threads safely future created by async block is not `Send` Help: within `prokio::pinned::RwLock<std::option::Option<std::string::String>>`, the trait `std::marker::Sync` is not implemented for `std::cell::UnsafeCell<std::vec::Vec<std::task::Waker>>` Note: captured value is not `Send` because `&mut` references cannot be sent unless their referent is `Send` Note: required for the cast from `[async block@src/actions/channel_manager.rs:44:37: 46:6]` to the object type `dyn futures::Future<Output = std::result::Result<(), actions::channel_manager::CreateJobError>> + std::marker::Send`
This even happens when not run inside a prokio task for some reason...
I couldn't find any information on actually using this crate. An example script file or at least a snippet of using it somewhere would help a ton.
I'm trying to use it as a replacement for tokio::runtime::Runtime
that will also work on the browser, but after constructing it and calling .spawn_pinned(..)
on it, I'm unsure what to do with the runtime. "Normally" I would call .block_on(..)
on this runtime in the main
function, but that method seems to be missing..
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.