Expand description
This crate provides the ability to spawn processes with a function similar
to thread::spawn
To use this crate, call mitosis::init()
at the beginning of your main()
,
and then anywhere in your program you may call mitosis::spawn()
:
let data = vec![1, 2, 3, 4];
mitosis::spawn(data, |data| {
// This will run in a separate process
println!("Received data {:?}", data);
});
mitosis::spawn()
can pass arbitrary serializable data, including IPC senders
and receivers from the ipc-channel
crate, down to the new process.
Structs§
- Builder
- Join
Handle - This value is returned by
mitosis::spawn
and lets you wait on the result of the child process’ computation