Coder Social home page Coder Social logo

prokio's People

Contributors

dependabot[bot] avatar futursolo avatar langyo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

prokio's Issues

Provide IO types

tokio provides the following IO types:

  1. Standard Input / Output
  2. TCP / UDP / Unix Sockets
  3. Named Pipes (Windows)

Whilst we cannot provide these traditional IO types when running in browsers, we can provide some other IO types:

  1. HTTP
  2. WebSockets
  3. WebRTC

Enable prokio for wasm32-wasi (tokio)

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:

  • Client-Side Rendering
    (wasi in Browser)
  • Server-Side Rendering
    (wasi in JavaScript-capable WebAssembly Runtime & Standalone WebAssembly Runtime)
  • Static-Site Generation
    (wasi in JavaScript-capable WebAssembly Runtime & Standalone WebAssembly Runtime)

This issue tracks the tokio features required to land wasi support for Yew Runtime:

  • wasi target currently lacks networking capability in general.
    (needed for CSR and SSR.)
    This is primarily due to sockets under wasi is not standardised.
    There is an alternative proposal for an HTTP interface.
  • tokio::fs for wasi.
    (needed for SSG and potentially SSR.)
  • multi-threading support so prokio can reliably spawn futures to current thread.

Prokio RwLock can not be sent across threads

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...

Provide example of using this crate

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.

My use case (not sure if it fits the scope of the crate):

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..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.