Coder Social home page Coder Social logo

corona's Introduction

Corona

Deprecated

This library supports tokio 0.1, which is outdated. There's not much need for it any more since Rust supports native async/await syntax. Use some of the async libraries directly.

About the library

Travis Build Status AppVeyor Build status

When you need to get the asynchronous out of the way.

Corona is a library providing stackful coroutines for Rust. They integrate well with futures โ€’ it is possible to switch between the abstractions as needed, each coroutine is also a future and a coroutine can wait for a future to complete. Furthermore, the futures don't have to be 'static.

On the other hand, there's a runtime cost to the library. The performance does not necessarily suffer (as seen in the benchmarks). But each coroutine has its own stack, which takes memory.

You want to read the docs and examine the examples.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

corona's People

Contributors

amilajack avatar matklad avatar vorner 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  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

corona's Issues

larger default stack size

This issue is to figure out what size the stack should be by default - the current one is small enough that it's really easy to run into stack overflow issues.

My best guess at a sensible default is to just use the default Linux thread stack size so that we won't run into stack overflows for normal rust code, which AFAICT is 8mb.

Setting stack size causes assertion error

Minimal example:

use corona::{coroutine::*, prelude::*};
use futures::future::Future;

#[test]
fn main() {
    Coroutine::new()
        .stack_size(10_000)
        .run(|| {})
        .expect("failed")
}

Having this bug with corona = 0.4 and futures = 0.1.

Multicore scheduling

Right now the only way to have Coroutines executing on multiple threads is to manually configure the threadpool upfront and again manually handle passing work between them. This is not ideal for being able to mix and match corona and futures based code, and additionally requires users to figure out inter-thread scheduling themselves.

I'm working on a fix to this in my fork right now, any tips on how I might go about it? Seems like the obvious things to do are to replace thread-local RefCells with something from futures-locks, and replace the unsync::oneshot channels with sync::oneshot.

Also, using thread-local storage for the coroutine builder is probably the wrong approach for this use case. Is there something better we could do instead? Maybe a global futures_locks::RwLock?

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.