-
-
Notifications
You must be signed in to change notification settings - Fork 873
feat(realtime): Realtime streams v2 #2632
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
Open
ericallam
wants to merge
50
commits into
main
Choose a base branch
from
feat/realtime-streams-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
9567a9c
fix(realtime): gracefully recover from ECONNRESET errors when sending…
ericallam ef7389b
Add support for multiple writers to a single stream by removing the E…
ericallam da7d035
Make the MetadataStream client more robust to failure and add tests
ericallam 91b09b3
Make the stream client more resilient and robust, including implement…
ericallam 20a5323
Add some more streaming examples and markdown streaming
ericallam 5ef2336
s2 WIP
ericallam 3820e0c
Added realtimeStreams column to TaskRun to replace using metadata for…
ericallam 46686dd
Write to s2 from the client instead of the server
ericallam 1f27fc0
WIP
ericallam 0a4b990
Add env var
ericallam 193afd8
Loads more stuff
ericallam f956523
The stream.read() span now works better when specifying a startIndex
ericallam e2fbbf2
WIP
ericallam 5f7a5da
Configure the waitUntil timeout via an env var
ericallam c5d32ef
Return stream parts from SSE class
ericallam df3016b
Adds new streams icon
samejr 91db7ed
Layout improvements to streams inspector
samejr 810272c
Improve layout of streams inspector
samejr 4f6035c
Remove tabs if only Overview is shown
samejr 2b09eed
Added compact view for streams and sticky copy button
ericallam d8e0598
Add AI SDK demo
ericallam ce5dac4
experiment_throttle is now just throttle
ericallam 8f6a94f
Show textwrapping, copy and modal buttons on the Properties code blocks
samejr 13cbac7
Use simplr library for plurals and flex wrap the heading info nicely
samejr 65962c8
Moves toggle button functionality into the header with new icons
samejr 744aca5
Make sure the scroll view knows if it’s at the top or bottom even if …
samejr 44c277c
Improve loading states
samejr f50fd55
Add divide between heads and inspector content
samejr ea890a9
Remove 0 padding
samejr d4a5771
Adds nice behaviour if a long stream key is used
samejr 183e68a
Disable the header buttons if the content is loading
samejr bc404d0
Fixed failing test
ericallam e48ff0d
Improved X-Resume-From-Chunk header parsing
ericallam 064b562
Unify inactivity timeout threshold
ericallam 9c46d5d
If v2 streams is requested, throw an error if S2 env vars are not set
ericallam 3b559e1
Use implicit radix arg when calling parseInt
ericallam 1a1ebad
Consistent API client creation
ericallam a0f88db
Normalize the stream source to an async iterable before passing to th…
ericallam 8d2625a
Refactor the metadata streams stuff to be better
ericallam 2417983
properly abort streams when the waitUntil timeout occurs
ericallam 377dbc7
fix the new configurable waitUntil timeout
ericallam 8f93d86
prevent memory leaks by cleaning up responses and requests
ericallam 0c5da21
Fix timer leak
ericallam 7495397
use server provided options for the s2 writer
ericallam 2eaf483
s2 stream writer now handles abort signals
ericallam 6b018e0
Fixed core tests
ericallam 80569bd
No need to use keys and a Map for stream management
ericallam 792c02f
Fixed runStream tests
ericallam 667bf8d
Implement TRIGGER_V2_REALTIME_STREAMS env var
ericallam 2da5fe2
Runs now have a "default" stream
ericallam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@trigger.dev/sdk": patch | ||
| --- | ||
|
|
||
| gracefully recover from ECONNRESET errors when sending stream data from tasks to the server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| export function ListBulletIcon({ className }: { className?: string }) { | ||
| return ( | ||
| <svg className={className} viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
| <path | ||
| d="M9 5H20" | ||
| stroke="currentColor" | ||
| strokeWidth="2" | ||
| strokeLinecap="round" | ||
| strokeLinejoin="round" | ||
| /> | ||
| <path | ||
| d="M9 12H20" | ||
| stroke="currentColor" | ||
| strokeWidth="2" | ||
| strokeLinecap="round" | ||
| strokeLinejoin="round" | ||
| /> | ||
| <path | ||
| d="M9 19H20" | ||
| stroke="currentColor" | ||
| strokeWidth="2" | ||
| strokeLinecap="round" | ||
| strokeLinejoin="round" | ||
| /> | ||
| <circle cx="4" cy="5" r="1" fill="currentColor" /> | ||
| <circle cx="4" cy="12" r="1" fill="currentColor" /> | ||
| <circle cx="4" cy="19" r="1" fill="currentColor" /> | ||
| </svg> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| export function MoveToBottomIcon({ className }: { className?: string }) { | ||
| return ( | ||
| <svg className={className} viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
| <path | ||
| d="M12 15L12 3" | ||
| stroke="currentColor" | ||
| strokeWidth="2" | ||
| strokeLinecap="round" | ||
| strokeLinejoin="round" | ||
| /> | ||
| <path | ||
| d="M3 21L21 21" | ||
| stroke="currentColor" | ||
| strokeWidth="2" | ||
| strokeLinecap="round" | ||
| strokeLinejoin="round" | ||
| /> | ||
| <path | ||
| d="M7.5 12.5L12 17L16.5 12.5" | ||
| stroke="currentColor" | ||
| strokeWidth="2" | ||
| strokeLinecap="round" | ||
| strokeLinejoin="round" | ||
| /> | ||
| </svg> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| export function SnakedArrowIcon({ className }: { className?: string }) { | ||
| return ( | ||
| <svg className={className} viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
| <path | ||
| d="M5 5H16C17.6569 5 19 6.34315 19 8L19 8.5C19 10.1569 17.6569 11.5 16 11.5H8C6.34314 11.5 5 12.8431 5 14.5L5 15C4.99999 16.6569 6.34314 18 8 18H18.634" | ||
| stroke="currentColor" | ||
| strokeWidth="2" | ||
| strokeLinecap="round" | ||
| strokeLinejoin="round" | ||
| /> | ||
| <path | ||
| d="M16 21L19 18L16 15" | ||
| stroke="currentColor" | ||
| strokeWidth="2" | ||
| strokeLinecap="round" | ||
| strokeLinejoin="round" | ||
| /> | ||
| </svg> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| export function StreamsIcon({ className }: { className?: string }) { | ||
| return ( | ||
| <svg className={className} viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
| <path d="M3 19C3 19 5.01155 17 8 17C10.9885 17 13 18.9973 16 18.9973C19 18.9973 21 17 21 17" stroke="currentColor" strokeWidth="2" strokeLinecap="round"/> | ||
| <path d="M3 13.0001C3 13.0001 5.01155 11 8 11C10.9885 11 13 13 16 13C19 13 21 11.0001 21 11.0001" stroke="currentColor" strokeWidth="2" strokeLinecap="round"/> | ||
| <path d="M3 7C3 7 5.01155 5 8 5C10.9885 5 13 6.9973 16 6.9973C19 6.9973 21 5 21 5" stroke="currentColor" strokeWidth="2" strokeLinecap="round"/> | ||
| </svg> | ||
| ); | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.