Implement editor level future message handler (#4182)

* Implement proper editor level async message handler

* Take application_io and wake callback as Editor::new arguments

* Rename AsyncMessage -> FutureMessage

* add DesktopWrapperMessage::Wake

---------

Co-authored-by: Timon <me@timon.zip>
This commit is contained in:
Dennis Kobert
2026-05-31 21:26:29 +00:00
committed by GitHub
co-authored by Timon
parent 51427bef5f
commit 78679a5ba2
22 changed files with 261 additions and 82 deletions
@@ -0,0 +1,16 @@
use crate::messages::future::MessageFuture;
use crate::messages::prelude::*;
#[impl_message(Message, Future)]
#[derive(derivative::Derivative, Clone, serde::Serialize, serde::Deserialize)]
#[derivative(Debug, PartialEq)]
pub enum FutureMessage {
/// Spawn `future`; its resolved [`Message`] re-enters the dispatcher on the next tick.
Await {
#[serde(skip, default)]
#[derivative(Debug = "ignore", PartialEq = "ignore")]
future: MessageFuture,
},
/// Sent by a wake callback to nudge an idle event loop into a dispatch tick.
Wake,
}