mirror of
https://github.com/sayanarijit/xplr.git
synced 2024-09-11 11:05:39 +03:00
Bring back enqueue
This commit is contained in:
parent
cae50e4bcf
commit
33c5aa9f14
@ -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…
Reference in New Issue
Block a user