-
Notifications
You must be signed in to change notification settings - Fork 4
fix(ext/sse): improved keepalive #81
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
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe KeepAlive method is refactored to accept an external context and use time.After for interval handling instead of a default Sleep, with accompanying test updates to match the new signature. Sequence diagram for updated KeepAlive method with external contextsequenceDiagram
participant ExternalContext as ctx: context.Context
participant Server
participant Client
loop every timeout interval
ExternalContext->>Server: ctx.Done()?
Server->>ExternalContext: check ctx.Done()
alt ctx.Done()
Server->>Server: return (stop KeepAlive)
else time.After(timeout)
Server->>Client: check client activity
Server->>Client: mark dead clients
end
end
Class diagram for updated Server KeepAlive methodclassDiagram
class Server {
+KeepAlive(ctx context.Context)
-KeepAlive()
...
}
class Client
Server "1" -- "*" Client: manages
class context.Context
Server ..> context.Context: uses in KeepAlive
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the code health analysis summary for commits Analysis Summary
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #81 +/- ##
=======================================
Coverage 91.70% 91.70%
=======================================
Files 66 66
Lines 2675 2676 +1
=======================================
+ Hits 2453 2454 +1
Misses 192 192
Partials 30 30
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Changed
Fixed
Added
Tests
Tasks to complete before merging PR:
make unit-tests
to check for any regressions 📋make lint
to check for any issuesSummary by Sourcery
Refactor SSE server’s keepalive routine to use an external context for cancellation and switch from time.Sleep to time.After for pacing keepalive checks
Enhancements:
Tests: