1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! [`WakeSender`] — host-agnostic cross-thread wake-up.
//!
//! Apps stash an `Arc<dyn WakeSender<UserEvent>>` and clone it across background threads (network workers, IO tasks, async ceremonies). When a background task wants the UI to repaint with a result, it calls `wake.send(payload)`; the concrete impl routes the payload back thru `FluorApp::on_user_event` on the UI thread.
//!
//! Hosts provide concrete impls: host-winit wraps `winit::event_loop::EventLoopProxy` (in [`super::winit_compat`]); host-android wires JNI callbacks (or a no-op proxy if the app doesn't use cross-thread wake-ups — the Activity polls via Choreographer).
//!
//! This decouples `FluorApp` from winit's `EventLoopProxy` type, which is what made winit a transitive dep on Android even tho we never run winit's event loop there.
use type_name;
/// Errors returned by [`WakeSender::send`]. The runtime is responsible for deciding whether a send failure should be silently logged, retried, or panicked on; the trait surface stays minimal.
/// Cross-thread wake-up channel from app background tasks back to the UI thread. Host provides a concrete impl when constructing the shell.
/// No-op wake sender. Used when the host can't provide a working channel (e.g. host-android before Choreographer + JNI callbacks are wired) but the type must still satisfy the trait. Every `send` returns `Err` so callers' best-effort send loops don't busy-spin assuming success.
;