Sample Points node: employ caching and deduplication (#1546)

Sample Points node: split out expensive computation so it can be deduped
This commit is contained in:
Keavon Chambers
2024-01-06 16:07:45 -08:00
committed by GitHub
parent 93aa10a76f
commit 121c1d2b9d
5 changed files with 75 additions and 9 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ where
for<'a> <CachedNode as Node<'a, ()>>::Output: core::future::Future<Output = T> + 'a,
{
// TODO: This should return a reference to the cached cached_value
// but that requires a lot of lifetime magic <- This was suggested by copilot but is pretty acurate xD
// but that requires a lot of lifetime magic <- This was suggested by copilot but is pretty accurate xD
type Output = Pin<Box<dyn Future<Output = T> + 'i>>;
fn eval(&'i self, input: ()) -> Pin<Box<dyn Future<Output = T> + 'i>> {
Box::pin(async move {