Make isInKeepAlivePeriod as private (dart-lang/sse#20)
* Make isInKeepAlivePeriod as private
* fix doc
* fix markdown
diff --git a/pkgs/sse/CHANGELOG.md b/pkgs/sse/CHANGELOG.md
index 022f120..d584733 100644
--- a/pkgs/sse/CHANGELOG.md
+++ b/pkgs/sse/CHANGELOG.md
@@ -1,3 +1,10 @@
+## 3.1.1
+
+- Make `isInKeepAlive` on `SseConnection` private.
+
+**Note that this is a breaking change but in actuality no one should be
+ depending on this API.**
+
## 3.1.0
- Add optional `keepAlive` parameter to the `SseHandler`. If `keepAlive` is
@@ -9,8 +16,8 @@
- Add retry logic.
-** Possible Breaking Change ** Error messages may now be delayed up to 5 seconds
-in the client.
+**Possible Breaking Change Error messages may now be delayed up to 5 seconds
+ in the client.**
## 2.1.2
diff --git a/pkgs/sse/lib/src/server/sse_handler.dart b/pkgs/sse/lib/src/server/sse_handler.dart
index e8cd523..9c3d91e 100644
--- a/pkgs/sse/lib/src/server/sse_handler.dart
+++ b/pkgs/sse/lib/src/server/sse_handler.dart
@@ -37,7 +37,7 @@
Timer _keepAliveTimer;
/// Whether this connection is currently in the KeepAlive timeout period.
- bool get isInKeepAlivePeriod => _keepAliveTimer?.isActive ?? false;
+ bool get _isInKeepAlivePeriod => _keepAliveTimer?.isActive ?? false;
final _closedCompleter = Completer<void>();
@@ -60,7 +60,7 @@
while (await outgoingStreamQueue.hasNext) {
// If we're in a KeepAlive timeout, there's nowhere to send messages so
// wait a short period and check again.
- if (isInKeepAlivePeriod) {
+ if (_isInKeepAlivePeriod) {
await Future.delayed(const Duration(milliseconds: 200));
continue;
}
@@ -105,7 +105,7 @@
if (_keepAlive == null) {
// Close immediately if we're not keeping alive.
_close();
- } else if (!isInKeepAlivePeriod) {
+ } else if (!_isInKeepAlivePeriod) {
// Otherwise if we didn't already have an active timer, set a timer to
// close after the timeout period. If the connection comes back, this will
// be cancelled and all messages left in the queue tried again.
@@ -155,7 +155,7 @@
// Check if we already have a connection for this ID that is in the process
// of timing out (in which case we can reconnect it transparently).
if (_connections[clientId] != null &&
- _connections[clientId].isInKeepAlivePeriod) {
+ _connections[clientId]._isInKeepAlivePeriod) {
_connections[clientId]._acceptReconnection(sink);
} else {
var connection = SseConnection(sink, keepAlive: _keepAlive);
diff --git a/pkgs/sse/pubspec.yaml b/pkgs/sse/pubspec.yaml
index 9c164f7..52d69e5 100644
--- a/pkgs/sse/pubspec.yaml
+++ b/pkgs/sse/pubspec.yaml
@@ -1,5 +1,5 @@
name: sse
-version: 3.1.0
+version: 3.1.1
author: Dart Team <misc@dartlang.org>
homepage: https://github.com/dart-lang/sse
description: >-