Bring back enqueue

pull/639/head
Arijit Basu 11 months ago
parent cae50e4bcf
commit 33c5aa9f14
No known key found for this signature in database
GPG Key ID: 0F8EF5258DC38077

@ -665,7 +665,11 @@ impl App {
});
for msg in msgs {
self = self.handle_external(msg, Some(key))?;
// Rename breaks without enqueue
let external = MsgIn::External(msg);
let task = Task::new(external, Some(key));
let msg_out = MsgOut::Enqueue(task);
self.msg_out.push_back(msg_out);
}
Ok(self)

@ -1,6 +1,6 @@
use serde::{Deserialize, Serialize};
use crate::app::Command;
use crate::app::{Command, Task};
#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)]
pub enum MsgOut {
@ -33,4 +33,5 @@ pub enum MsgOut {
PrintSelectionAndQuit,
PrintResultAndQuit,
PrintAppStateAndQuit,
Enqueue(Task),
}

@ -349,6 +349,10 @@ impl Runner {
while let Some(msg) = app.msg_out.pop_front() {
use app::MsgOut::*;
match msg {
Enqueue(task) => {
tx_msg_in.send(task)?;
}
Quit => {
result = Ok(None);
break 'outer;

Loading…
Cancel
Save