next.js
f96f6ada - Reach backend via pinned turbo_tasks instead of cloning self

Commit
123 days ago
Reach backend via pinned turbo_tasks instead of cloning self idle_start and try_read_task_output each took self: &Arc<Self> only to move a self.clone() into a deferred task/closure. But both already pin turbo_tasks (Arc<TurboTasks>), which owns the backend, so the spawned work can reach the backend through turbo_tasks.backend().0 — its lifetime is anchored by the pin. Drop both clones and take &self. This removes the last self: &Arc<Self> receivers and self.clone() calls in the crate; the inner Arc is no longer used for shared ownership.
Author
Parents
Loading