Added non-panic error handling for the sink
This commit is contained in:
parent
1f3ec2bf39
commit
81746dd5dc
11
src/main.rs
11
src/main.rs
|
@ -130,11 +130,18 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||||
.map_err(|e| Box::new(e) as Box<dyn Error>);
|
.map_err(|e| Box::new(e) as Box<dyn Error>);
|
||||||
|
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
sender
|
loop {
|
||||||
|
if let Err(err) = sender
|
||||||
|
.clone() // Does this even make sense??? Can you clone a sender?? am i fucked now??
|
||||||
|
// shouldnt it be re-init'd?
|
||||||
.sink_map_err(|e| Box::new(e) as Box<dyn Error>)
|
.sink_map_err(|e| Box::new(e) as Box<dyn Error>)
|
||||||
.send_all(&mut model)
|
.send_all(&mut model)
|
||||||
.await
|
.await
|
||||||
.expect("Broken buffer");
|
{
|
||||||
|
// Idk what to do here, remake stream? what? idk, im not rustie
|
||||||
|
println!("got error on sender stream: {}", err);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
publisher
|
publisher
|
||||||
|
|
Loading…
Reference in New Issue