-
Notifications
You must be signed in to change notification settings - Fork 24
Support shutting down the handler ignoring any keepAlive periods #27
Conversation
This is for application-initiated shutdowns (for ex. hitting Ctrl+C in the terminal of a running server).
This fix might not be complete... The test passes, but in webdev it still hangs (possibly due to the timers not being cancelled)... will look for a way to fix. |
(ok, this seems to work now) |
@jakemac53 @grouma ping! |
Let's get a changelog and version update and I'll publish. Otherwise LGTM. |
Done, thanks! |
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.
Sorry. One last minor fix.
test/sse_test.dart
Outdated
// Close the underlying connection. | ||
handler.shutdown(); | ||
|
||
// The isInKeepAlivePeriod flag may only be set for a short period because |
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.
This comment no longer makes sense.
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.
np, updated!
…t-archive/sse#27) * Support shutting down the handler ignoring any keepAlive periods
I think we need something like this in order to fix dart-lang/webdev#950. The issue is that the keepAlive period fires for the injected client handler and prevents the daemon from ending until the keepAlive timer runs out.
This exposes a
shutdown
method on the handler that will close all connections ignoring the keepAlive.