Let the users wake up the event loop and then they could poll their user sources. Co-authored-by: Mads Marquart <mads@marquart.dk> Co-authored-by: daxpedda <daxpedda@gmail.com>
19 lines
361 B
Rust
19 lines
361 B
Rust
use std::rc::Weak;
|
|
|
|
use super::runner::Execution;
|
|
use crate::platform_impl::platform::r#async::Waker;
|
|
|
|
#[derive(Clone)]
|
|
pub struct EventLoopProxy {
|
|
runner: Waker<Weak<Execution>>,
|
|
}
|
|
|
|
impl EventLoopProxy {
|
|
pub fn new(runner: Waker<Weak<Execution>>) -> Self {
|
|
Self { runner }
|
|
}
|
|
|
|
pub fn wake_up(&self) {
|
|
self.runner.wake();
|
|
}
|
|
}
|