vercel / vercel/resumable-stream

can not abort resumable-stream

Open
#19 3 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
574
Forks
44
Avg merge
3m
Merged PRs (30d)
1

Description

when a user clicks a button to stop generating, there is not an easy way to abort resumable-stream. can we add a method to do this?

add a method cancelExistingStream in ResumableStreamContext. in cancelExistingStream, set ${ctx.keyPrefix}:sentinel:${streamId} to CANCEL. after runtime.ts#L212, check ${ctx.keyPrefix}:sentinel:${streamId}, if it equals CANCEL, reader.cancel()

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ResumableStreamContext and runtime.ts around line 212, tracing how streamId and keyPrefix are used for the existing stream reader. Done means a caller can request cancellation through cancelExistingStream and the reader cancels when the corresponding sentinel is CANCEL; check the existing test structure for stream behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.