-
-
Couldn't load subscription status.
- Fork 868
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
49
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 31 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
0f7174f
fix(realtime): gracefully recover from ECONNRESET errors when sending…
ericallam b0257c1
Add support for multiple writers to a single stream by removing the E…
ericallam 25e7b10
Make the MetadataStream client more robust to failure and add tests
ericallam c83a016
Make the stream client more resilient and robust, including implement…
ericallam 39c5433
Add some more streaming examples and markdown streaming
ericallam e55eb39
s2 WIP
ericallam caa2bce
Added realtimeStreams column to TaskRun to replace using metadata for…
ericallam ad89fe9
Write to s2 from the client instead of the server
ericallam 7abcba2
WIP
ericallam e167ec6
Add env var
ericallam 22e70a7
Loads more stuff
ericallam e0b90cf
The stream.read() span now works better when specifying a startIndex
ericallam fbb89eb
WIP
ericallam 4dea42e
Configure the waitUntil timeout via an env var
ericallam 13f54f1
Return stream parts from SSE class
ericallam 69fc795
Adds new streams icon
samejr c03a0a9
Layout improvements to streams inspector
samejr a63fe6e
Improve layout of streams inspector
samejr aaf34ae
Remove tabs if only Overview is shown
samejr 433314a
Added compact view for streams and sticky copy button
ericallam a68236d
Add AI SDK demo
ericallam 62aa122
experiment_throttle is now just throttle
ericallam 81e9fc4
Show textwrapping, copy and modal buttons on the Properties code blocks
samejr 3b648d6
Use simplr library for plurals and flex wrap the heading info nicely
samejr e591f20
Moves toggle button functionality into the header with new icons
samejr 9e4588d
Make sure the scroll view knows if it’s at the top or bottom even if …
samejr c54e8b7
Improve loading states
samejr 650868e
Add divide between heads and inspector content
samejr 330ffc8
Remove 0 padding
samejr 114f4b9
Adds nice behaviour if a long stream key is used
samejr 3eef678
Disable the header buttons if the content is loading
samejr 1ee382c
Fixed failing test
ericallam 7425d11
Improved X-Resume-From-Chunk header parsing
ericallam ac297f2
Unify inactivity timeout threshold
ericallam 53de355
If v2 streams is requested, throw an error if S2 env vars are not set
ericallam 4de63e8
Use implicit radix arg when calling parseInt
ericallam 9a55dbb
Consistent API client creation
ericallam 6de9bbe
Normalize the stream source to an async iterable before passing to th…
ericallam b4cc986
Refactor the metadata streams stuff to be better
ericallam 50a57a9
properly abort streams when the waitUntil timeout occurs
ericallam 58ef014
fix the new configurable waitUntil timeout
ericallam 03a9079
prevent memory leaks by cleaning up responses and requests
ericallam 7408e82
Fix timer leak
ericallam 440f2e7
use server provided options for the s2 writer
ericallam 442979f
s2 stream writer now handles abort signals
ericallam 2246e6e
Fixed core tests
ericallam 1a14f7f
No need to use keys and a Map for stream management
ericallam a9ae1b8
Fixed runStream tests
ericallam ed1f590
Implement TRIGGER_V2_REALTIME_STREAMS env var
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.
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.