✨ multi threaded workers
This commit is contained in:
parent
0c190df5d7
commit
e827faaa3f
7 changed files with 208 additions and 45 deletions
|
@ -71,12 +71,14 @@ You can annotate a function with `#[worker]` which gives them superpowers. These
|
|||
```rust
|
||||
use comrade::{worker};
|
||||
|
||||
// Single local worker
|
||||
#[worker]
|
||||
pub fn myfn(i: i32) -> i32 {
|
||||
i * 2
|
||||
}
|
||||
|
||||
#[worker]
|
||||
// 4 local worker threads
|
||||
#[worker(4)]
|
||||
pub fn multiply(a: i32, b: i32) -> i32 {
|
||||
a * b
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue