context_bind

Crates.iocontext_bind
lib.rscontext_bind
version0.0.2
sourcesrc
created_at2016-11-03 01:13:15.263732
updated_at2016-11-03 02:09:25.657442
descriptionSimple M:N threading library. Should support Linux, MacOS, Free/OpenBSD, and Windows for x86/64, and aarch32/64
homepagehttps://github.com/valarauca/context_bind
repositoryhttps://github.com/valarauca/context_bind.git
max_upload_size
id7117
size794,538
Cody Laeder (valarauca)

documentation

https://valarauca.github.io/context_bind/context_bind/index.html

README

context_bind

Binds I want out of context-rs

Documents

These are simple bindings to context lib. The goal is to make a more object orriented runtime. With a free return function, that can be more easily embedded within external libraries (the goal is to make it easier to embed async-mio functionality).


    use context_bind::{Routine,StackSize,swap};
    
    let lambda = Box::new(||{
        for i in 0usize.. {
            swap(i*2);
        }
    });
    let lambda2 = Box::new(||{
        for i in 0usize.. {
            swap(i*4);
        }
    });
    let mut dut0 = Routine::new(lambda,1,StackSize::KiB8).unwrap();
    let mut dut1 = Routine::new(lambda2,2,StackSize::KiB8).unwrap();
    for x in 0..10 {
        let a = dut0.exec(0);
        let b = dut1.exec(0);
        assert_eq!(a,x*2);
        assert_eq!(b,x*4);
    }

To integrate use the following in your Cargo.toml file.

[dependencies]
context_bindings = "0.0.1"

A special thanks to the authors of context-rs without this library would not exist.

Y. T. CHUNG

Leonard Hecker

Commit count: 30

cargo fmt