Coder Social home page Coder Social logo

Comments (3)

Verdagon avatar Verdagon commented on July 20, 2024

Temporary workaround shown in https://github.com/Verdagon/RustFearlessStructuredConcurrency/blob/1734c0a7a2fe779390941a3bfe90e33efc698dfa/src/main.rs

TL;DR: instead of: Scope::scope_and_block(|s| { ... do:

Scope::scope_and_block(|s: &mut async_scoped::Scope<'_, (), async_scoped::spawner::use_async_std::AsyncStd>| { ...

This does require a change to async-scoped source code though, to make spawner public. Specifically, in async-scoped/src/lib.rs, change mod spawner; to pub mod spawner;.

from async-scoped.

rmanoka avatar rmanoka commented on July 20, 2024

The inference failure is intended as Scope is the general structure that supports both async-std and tokio. To use async-std, make sure you have enabled the use-async-std feature of the crate, and use AsyncScope instead of Scope. Pls. refer example in the docs: https://docs.rs/async-scoped/latest/async_scoped/#scope-api

from async-scoped.

Verdagon avatar Verdagon commented on July 20, 2024

That solved it! I'm not sure how I missed that, it felt like I'd tried everything at the time.

Thank you for your help!

from async-scoped.

Related Issues (18)

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.