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

Unable to cancel or abort streaming UI server actions #1122

Open
AaronFriel opened this issue Mar 7, 2024 · 1 comment
Open

Unable to cancel or abort streaming UI server actions #1122

AaronFriel opened this issue Mar 7, 2024 · 1 comment

Comments

@AaronFriel
Copy link

Feature Description

Provide an ambient AbortController via an API to server actions and a method for cancelling a request.

Use Case

Users may wish to cancel and retry long-running AI requests, especially in streaming and langchain-esque scenarios where completion times are on the order of tens of seconds or longer.

Additional context

Attempting to work around the issue by, e.g., passing a Promise to the server action does not work, as Next.js delays calling the server action while the promise resolves. This can be demonstrated by calling a server action with new Promise<void>((r) => setTimeout(r, 10_000)) and logging the un-awaited value of the promise immediately in the action.

Related issues:

@fjun99
Copy link

fjun99 commented Mar 24, 2024

also interested in this.

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

No branches or pull requests

2 participants