Expand description
Task for remote execution
§Example
ⓘ
let (rx, tx) = Task::new().split();
// client side
tx_input1 = tx.clone();
tx_input2 = tx.clone();
let out1 = tx_input1.send("test input 1")?;
let out2 = tx_input2.send("test input 2")?;
// server side
if let Some(RemoteIO(input, tx_out)) = rx.recv().await {
// compute with job input
let output = compute_with(input)?;
// send job output to client side
tx_out.send(output)?;
} else {
// task channel closed
// ...
}Structs§
- RemoteIO
- RemoteIO contains input and output for remote execution. The first field in tuple is job input, and the second is for writing job output.
- Task
- A Task channel for remote execution (multi-producer, single-consumer)
- Task
Receiver - The server side for remote execution
- Task
Sender - The client side for remote execution