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: Add signal/timeout options to RunnableConfig #6305

Merged
merged 20 commits into from
Aug 2, 2024

Conversation

nfcampos
Copy link
Collaborator

@nfcampos nfcampos commented Aug 1, 2024

  • Handled by all built-in runnables
  • Handled by all utility methods in base runnable, which should propagate to basically all runnables

Fixes # (issue)

- Handled by all built-in runnables
- Handled by all utility methods in base runnable, which should propagate to basically all runnables
Copy link

vercel bot commented Aug 1, 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 2, 2024 11:40pm
langchainjs-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 2, 2024 11:40pm

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. auto:improvement Medium size change to existing code to handle new use-cases labels Aug 1, 2024
this,
inputs,
optionsList,
runManagers,
batchOptions
);
outputs = optionsList?.[0]?.signal
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice

output = options?.signal
? await Promise.race([
promise,
new Promise<never>((_, reject) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, edge case but what if someone passes an already aborted signal/there's some race condition?

Feel like there should be a check?

if (signal === undefined) {
return promise;
}
if (signal.aborted) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@nfcampos If we have this check here, do we need all the signal.throwIfAborted() calls elsewhere?

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Aug 2, 2024
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:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants