Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core[patch]: Remove signal event listener when completed #6497

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

jacoblee93
Copy link
Collaborator

@jacoblee93 jacoblee93 commented Aug 12, 2024

Partially fixes #6461, though if more than 10 runnables in a chain run in parallel this warning will likely resurface.

CC @nfcampos

Copy link

vercel bot commented Aug 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 12, 2024 0:53am
langchainjs-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 12, 2024 0:53am

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. auto:improvement Medium size change to existing code to handle new use-cases labels Aug 12, 2024
@jacoblee93 jacoblee93 merged commit 228c1eb into main Aug 12, 2024
38 checks passed
@jacoblee93 jacoblee93 deleted the jacob/signal branch August 12, 2024 12:58
@@ -14,13 +15,14 @@ export async function raceWithSignal<T>(
}
}),
new Promise<never>((_, reject) => {
signal.addEventListener("abort", () => {
listener = () => {
reject(new Error("Aborted"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the remove call should be inside the listener?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could add it in both places but it should be removed once the promise resolves too?

What's the benefit to putting it within the listener vs. in finally?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:improvement Medium size change to existing code to handle new use-cases size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
2 participants