queuingtask 0.2.0

queueingtask is a library for running different threads in order in Rust
Documentation
  • Coverage
  • 0%
    0 out of 9 items documented0 out of 4 items with examples
  • Size
  • Source code size: 7.9 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.59 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • j6k1/queuingtask
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • j6k1

queuingtask

Rustで順番に異なるスレッドを実行するためのライブラリ

使い方

extern crate queuingtask;
 
let mut thread_queue = ThreadQueue::new();
thread_queue.submit(move || {
  print!("aaaaaa");
  1
});

※スレッドはsubmitに渡した順番で順次実行されます。 前のスレッドの実行が終了するまで次のスレッドはブロックされます。

Cargo.toml

[package]
name = "hoge"
version = "0.1.0"
authors = ["yourname"]

[dependencies.queuingtask]
git = "https://github.com/j6k1/queuingtask.git"

戻り値を受け取る

let h = thread_queue.submit(move || {
  print!("aaaaaa");
  1
});
/// スレッドの終了を待機
let r = h.join().unwrap();