这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@yangshun
Copy link
Contributor

No description provided.

@vercel
Copy link
Contributor

vercel bot commented Dec 12, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/vercel/turbo-site/A8opxbTrsvBwUXqfx4a6iMGVizCY
✅ Preview: https://turbo-site-git-fork-yangshun-yangshun-spellcheck.vercel.sh

@jaredpalmer jaredpalmer merged commit d528e54 into vercel:main Dec 12, 2021
@yangshun yangshun deleted the yangshun/spellcheck branch December 12, 2021 11:21
sokra added a commit that referenced this pull request Oct 25, 2022
This adds two new APIs:

```rs
turbo_tasks::emit(some_trait_vc)
```

emits some kind of value to the current task. It will bubble up the call graph until processed via:

```rs
let some_vc = some_function();
let all_emitted_vcs: Vec<SomeTraitVc> = some_vc.peek_collectibles::<SomeTraitVc>().await?;
// or
let all_emitted_vcs: Vec<SomeTraitVc> = some_vc.take_collectibles::<SomeTraitVc>().await?;
```

The `peek` variant will return the emitted values, but they will continue to bubble up the call graph.
The `take` variant will stop bubbling and parent tasks will not see these values. You may re-emit them via `emit()` again.
Peeking is a bit more efficient.

Emitting is pretty cheap. Peeking and taking is counted as read operation and the task will invalidate when new values are emitted or existing ones are removed.

---

This also improves the error handling for node-file-trace:

![image](https://user-images.githubusercontent.com/1365881/182683991-84c6dfe1-effc-4433-9f3c-c12e51828f47.png)

but there is still a lot to do to improve that...
sokra pushed a commit that referenced this pull request Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants