Giter Site home page Giter Site logo

fibers-rs's People

Contributors

kingofgreen avatar koba-e964 avatar samoxive avatar shinnya avatar sile avatar yutopp 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  avatar  avatar  avatar  avatar  avatar  avatar

fibers-rs's Issues

Does not compile on stable

I have the latest Rust stable compiler, a total fresh test project, and fibers does not compile.

λ ~/programming/rust/testing/ master cargo --version
cargo 0.25.0 (96d8071da 2018-02-26)
λ ~/programming/rust/testing/ master rustc --version
rustc 1.24.1 (d3ae9a9e0 2018-02-27)
λ ~/programming/rust/testing/ master cat Cargo.toml 
[package]
name = "testing"
version = "0.1.0"
authors = ["Orson Peters <[email protected]>"]

[dependencies]
fibers = "0.1"
λ ~/programming/rust/testing/ master cargo clean
λ ~/programming/rust/testing/ master cargo build
   Compiling lazycell v0.6.0
   Compiling byteorder v1.2.1
   Compiling slab v0.4.0
   Compiling cfg-if v0.1.2
   Compiling libc v0.2.39
   Compiling nbchan v0.1.2
   Compiling splay_tree v0.2.9
   Compiling futures v0.1.19
   Compiling log v0.4.1
   Compiling num_cpus v1.8.0
   Compiling iovec v0.1.2
   Compiling net2 v0.2.32
   Compiling mio v0.6.14
   Compiling handy_async v0.2.13
   Compiling fibers v0.1.9
error[E0599]: no method named `poll` found for type `&mut std::option::Option<sync::oneshot::Monitor<(), std::io::Error>>` in the current scope
   --> /home/orlp/.cargo/registry/src/github.com-1ecc6299db9ec823/fibers-0.1.9/src/net/tcp.rs:327:52
    |
327 |             if let Err(e) = self.monitor(interest).poll() {
    |                                                    ^^^^
    |
    = note: the method `poll` exists but the following trait bounds were not satisfied:
            `&mut std::option::Option<sync::oneshot::Monitor<(), std::io::Error>> : futures::Future`
            `&mut std::option::Option<sync::oneshot::Monitor<(), std::io::Error>> : futures::Stream`

error: aborting due to previous error

error: Could not compile `fibers`.

To learn more, run the command again with --verbose.

Switch to futures 0.3

Depending on futures 0.1 is causing me headaches, because the traits mismatch (I have two different futures versions in my dependency tree).

Add new tasks after the creation of an executor

Hi,

Is it somehow possible for an Executor to be shared between threads and also be used for adding new tasks during runtime?

I am thinking of something like:

// Create a shared executor
let mut executor_mutex = Arc::new(Mutex::new(ThreadPoolExecutor::new().unwrap()));

// Clone it
let ce = executor_mutex.clone();

// A different thread, at some poipnt spawns new tasks on the executor
thread::spawn(move || {
    let mut executor = ce.lock().unwrap();
    executor.spawn(futures::lazy(|| { println!("Hello"); Ok(())} ));
});

let executor = executor_mutex.lock().unwrap();

// Run the executor
// Not possible, since the run method consumes the executor
executor.run();

I see that there is the run_once, but I suppose that this blocks until all the units that it includes finish. This would make the executor practically unavailable until then I guess.

On the other hand, I could just create one new executor whenever I wanted to execute some tasks, but then the occupied threads on the system would increase drastically if there are a lot of tasks to be executed and these tasks are long-lived...

Mutex for fibers

How do you handle a mutex with fibers? There is a library for fibers mutex?

Time to make a new release?

I saw that you updated to the 2018 edition of rust recently, but the published version on crates.io is from earlier; maybe it's time to publish a new version?

Comparison to tokio

Interesting crate. How does it compare to tokio? Are futures compatible? Can I use both tokio and fibers in my project? And can I use crates that depend on tokio with fibers?

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.