feat: implement SSE real-time streaming for simulations - #107
Conversation
…hm simulations - Add `StreamingService` to manage Server-Sent Events (SSE) emitting for Sorting, Searching, and Pathfinding - Use a gracefully shutdown cached thread pool in `StreamingService` to compute frames asynchronously - Create `StreamController` to expose GET endpoints returning `SseEmitter` - Add `sseClient.ts` to manage EventSource connections in the frontend - Update `SortingPage`, `SearchingPage`, and `PathfindingPage` to receive real-time streams instead of waiting for the full simulation payload
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Closes #90
This PR implements Server-Sent Events (SSE) streaming for algorithm simulations to improve real-time playback and handle large datasets without blocking.
Changes
StreamControllerandStreamingServiceusing Spring'sSseEmitter. Algorithm execution is offloaded to a managed thread pool that emits frames iteratively as they are computed.sseClient.tsto handleEventSourcelogic and query parameter mapping for grid matrices. RefactoredSortingPage,SearchingPage, andPathfindingPageto use the stream, appending incoming frames incrementally to the component state without overwriting.Tested locally using
mvn test,pnpm test, andpnpm run buildto ensure there are no regressions or syntax errors.PR created automatically by Jules for task 3411215096698983024 started by @Sanan507