macro_rules! produce_data_future {
    ($prod: expr, $data: expr, $code: block) => { ... };
}
Expand description

Generate a process instance for a given future with data

  • This is a macro helper for method ProcessProducer::named_process_with_future(...)
  • Typically, data may be anything whith shared handles moved to the future

§Example:

let producer = ProcessProducer::new(&send_to_master);
let task = || { println!("task"); };
let my_future = async { println!("async task"); };
let process_instance = produce_data_future!(producer,"My data", {
    task();
    my_future.await;
});