Web Async Rework (#3082)

This commit is contained in:
daxpedda 2023-10-16 15:50:22 +02:00 committed by GitHub
parent ef34692148
commit 48f6582eb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 653 additions and 421 deletions

View file

@ -27,11 +27,12 @@ pub(crate) struct PlatformSpecificEventLoopAttributes {}
impl<T> EventLoop<T> {
pub(crate) fn new(_: &PlatformSpecificEventLoopAttributes) -> Result<Self, EventLoopError> {
let (user_event_sender, user_event_receiver) = mpsc::channel();
let elw = RootEventLoopWindowTarget {
p: EventLoopWindowTarget::new(),
_marker: PhantomData,
};
Ok(EventLoop {
elw: RootEventLoopWindowTarget {
p: EventLoopWindowTarget::new(),
_marker: PhantomData,
},
elw,
user_event_sender,
user_event_receiver,
})
@ -101,7 +102,7 @@ impl<T> EventLoop<T> {
}
pub fn create_proxy(&self) -> EventLoopProxy<T> {
EventLoopProxy::new(self.elw.p.runner.clone(), self.user_event_sender.clone())
EventLoopProxy::new(self.elw.p.waker(), self.user_event_sender.clone())
}
pub fn window_target(&self) -> &RootEventLoopWindowTarget<T> {