acter_queue

Crates.ioacter_queue
lib.rsacter_queue
version0.1.0
sourcesrc
created_at2020-11-17 04:28:21.587628
updated_at2020-11-17 04:28:21.587628
descriptionfast speed thread safe async execute queue.
homepage
repositoryhttps://github.com/luyikk/actor_queue
max_upload_size
id313166
size7,484
(luyikk)

documentation

https://docs.rs/actor_queue

README

fast speed thread safe async execute queue

#Examples

use acter_queue::AQueue;
static mut VALUE:i32=0;

#[tokio::main]
async fn main()->Result<(),Box<dyn Error+Sync+Send>> {
    let queue = AQueue::new();
    let mut v=0i32;
    for i in 0..2000000 {
        v= queue.run(async move |x| unsafe {
            // thread safe execute
            VALUE += x;
            Ok(VALUE)
        }, i).await?;
    }

    assert_eq!(v,-1455759936);
   
}

Commit count: 0

cargo fmt