diff options
| author | Mason Reed <mason@vector35.com> | 2025-10-07 16:00:53 -0400 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-10-07 16:00:53 -0400 |
| commit | 481fb39a270ba426057a4a5b743ccf2a36089119 (patch) | |
| tree | 712bb15c6eaf20cc2bb54cce7e181c28d31a05f9 /plugins/warp/src/cache | |
| parent | 36fcdfacc26662ab968816f3a375112085c3cd18 (diff) | |
[WARP] Add optional `analysis.warp.fetcher` activity to run fetch networked functions as apart of initial analysis
This is off by default for the obvious reasons, we may also in the future want to expand upon this with a "matched view" such that the first step a user can take after loading is to validate what functions were matched and decide if they want to keep any of that data.
This fetch happens as apart of the initial analysis, such that a headless script will not return from the load function until it has finished fetching. We may want to add a configurable timeout, and/or run the fetch out of band (let load return before fetching finishes).
Diffstat (limited to 'plugins/warp/src/cache')
| -rw-r--r-- | plugins/warp/src/cache/container.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/warp/src/cache/container.rs b/plugins/warp/src/cache/container.rs index 59b31bad..0b478ed1 100644 --- a/plugins/warp/src/cache/container.rs +++ b/plugins/warp/src/cache/container.rs @@ -15,6 +15,15 @@ pub fn for_cached_containers(f: impl Fn(&dyn Container)) { } } +pub fn for_cached_containers_mut(f: impl Fn(&mut dyn Container)) { + let containers_cache = CONTAINER_CACHE.get_or_init(Default::default); + for container in containers_cache.iter() { + if let Ok(mut guarded_container) = container.write() { + f(guarded_container.as_mut()); + } + } +} + // TODO: The static lifetime here is a little wierd... (we need it to Box) pub fn add_cached_container(container: impl Container + 'static) { let containers_cache = CONTAINER_CACHE.get_or_init(Default::default); |
