MCPcopy Create free account
hub / github.com/angular/angular / query

Method query

packages/compiler-cli/preprocessor/ng-analyze/src/query/engine.rs:1156–1167  ·  view source on GitHub ↗

Request a query. If not already cached, the body is spawned onto the executor and a shared handle is stored; concurrent and subsequent requests reuse the same in-flight/completed task.

(self: &Arc<Self>, key: QueryKey)

Source from the content-addressed store, hash-verified

1154 /// Request a query. If not already cached, the body is spawned onto the executor and a shared
1155 /// handle is stored; concurrent and subsequent requests reuse the same in-flight/completed task.
1156 pub fn query(self: &Arc<Self>, key: QueryKey) -> crate::SharedQuery<CachedResult> {
1157 let me = self.clone();
1158 let mut hit = true;
1159 let query = self.cache.get_or_create(key, || {
1160 hit = false;
1161 spawn_shared(me.execute(key).boxed())
1162 });
1163 if hit {
1164 crate::perf::count_cache_hit(key.name());
1165 }
1166 query
1167 }
1168
1169 /// Dispatch a query key to its computation. Each arm may request sub-queries via `self`.
1170 pub(crate) fn execute(self: Arc<Self>, key: QueryKey) -> BoxFuture<'static, Arc<CachedResult>> {

Callers 8

validateHtmlFunction · 0.45
expectHtmlFunction · 0.45
query_with_depsMethod · 0.45
component_mappingMethod · 0.45
local_extra_importsMethod · 0.45

Calls 6

spawn_sharedFunction · 0.85
get_or_createMethod · 0.80
cloneMethod · 0.65
executeMethod · 0.65
count_cache_hitFunction · 0.50
nameMethod · 0.45

Tested by

no test coverage detected