Skip to main content

process_watch_events

Function process_watch_events 

Source
pub fn process_watch_events(
    server: ResMut<'_, AssetServer>,
    sources: Query<'_, '_, (Entity, &ImageSource)>,
    writer: MessageWriter<'_, AssetReloadRequested>,
    waker: Option<Res<'_, EventLoopWaker>>,
)
Expand description

Drains filesystem-watch events and invalidates the cache for every changed path.

On each event: pops the path from image_cache / svg_cache / failed_cache, fires AssetReloadRequested so consumers can re-enqueue, and bumps the request id of every entity currently holding an ImageSource(path) so any in-flight decode for the now-invalidated bytes is identified as stale on completion.