Viewing version 4.2.0. Open the latest package page.
sse
4.2.0Provides client and server functionality for setting up bi-directional communication through Server Sent Events (SSE) and corresponding POST requests.
Readme
Build Status pub package package publisher
This package provides support for bi-directional communication through Server Sent Events and corresponding POST requests.
This package is not intended to be a general purpose SSE package, but instead is
a bidirectional protocol for use when Websockets are unavailable. That is, both
the client and the server expose a sink and stream on which to send and
receive messages respectively.
Both the server and client have implicit assumptions on each other and therefore a client from this package must be paired with a server from this package.
Changelog
4.2.0
- Update the minimum Dart SDK version to
3.11.0. - Handle out of order disconnects and reconnects.
- Allow SSE connections to be reused if not in a keep alive period.
- Allow a debounce period after connections to ignore disconnects which may be from prior connections.
- Add logging when messages are received out of order.
4.1.8
- Simplify the format of client ID strings.
4.1.7
- Move to
dart-lang/toolsmonorepo.
4.1.6
- Require package
web: '>=0.5.0 <2.0.0'.
4.1.5
- Drop unneeded dependency on
package:js. - Update the minimum Dart SDK version to
3.3.0. - Support the latest
package:web.
4.1.4
- Fix incorrect cast causing failure with
dart2wasm.
4.1.3
- Update the minimum Dart SDK version to
3.2.0.
4.1.2
- Send
fetchrequests instead ofXHRrequests. - Add an optional
debugKeyparameter toSseClientto include in logging. - Add a dependency on
package:js. - Update the minimum Dart SDK version to
2.16.0.
4.1.1
- Apply
keepAlivelogic toSocketExceptions. - Switch from using
package:pedantictopackage:lints - Rev the minimum required SDK to 2.15.
- Populate the pubspec
repositoryfield.
4.1.0
- Limit the number of concurrent requests to prevent Chrome from automatically dropping them on the floor.
4.0.0
- Support null safety.
3.8.3
- Require the latest shelf and remove dead code.
3.8.2
- Complete
onConnectedwith an error if theSseClientreceives an error before the connection is successfully opened.
3.8.1
- Fix an issue where closing the
SseConnectionstream would result in an error.
3.8.0
- Add
onConnectedto replaceonOpen. - Fix an issue where failed requests would not add a
doneevent to the connectionsink.
3.7.0
- Deprecate the client's
onOpengetter. Messages will now be buffered until a connection is established.
3.6.1
- Drop dependency on
package:uuid.
3.6.0
- Improve performance by buffering out of order messages in the server instead of the client.
** Note ** This is not modelled as a breaking change as the server can handle messages from older clients. However, clients should be using the latest server if they require order guarantees.
3.5.0
- Add new
shutdownmethods onSseHandlerandSseConnectionto allow closing connections immediately, ignoring any keep-alive periods.
3.4.0
- Remove
onClosefromSseConnectionand ensure the correspondingsink.closecorrectly fires.
3.3.0
- Add an
onCloseevent to theSseConnection. This allows consumers to listen to this event in lue ofsseConnection.sink.doneas that is not guaranteed to fire.
3.2.2
- Fix an issue where
keepAlivemay cause state errors when attempting to send messages on a closed stream.
3.2.1
- Fix an issue where
keepAlivewould only allow a single reconnection.
3.2.0
- Re-expose
isInKeepAlivePeriodflag onSseConnection. This flag will betruewhen a connection has been dropped and is in the keep-alive period waiting for a client to reconnect.
3.1.2
- Fix an issue where the
SseClientwould not send adoneevent when there was an error with the SSE connection.
3.1.1
- Make
isInKeepAliveonSseConnectionprivate.
Note that this is a breaking change but in actuality no one should be depending on this API.
3.1.0
- Add optional
keepAliveparameter to theSseHandler. IfkeepAliveis supplied, the connection will remain active for this period after a disconnect and can be reconnected transparently. If there is no reconnect within that period, the connection will be closed normally.
3.0.0
- Add retry logic.
Possible Breaking Change Error messages may now be delayed up to 5 seconds in the client.
2.1.2
- Remove
package:httpdependency.
2.1.1
- Use proper headers delimiter.
2.1.0
- Support Firefox.
2.0.3
- Fix an issue where messages could come out of order.
2.0.2
- Support the latest
package:stream_channel. - Require Dart SDK
>=2.1.0 <3.0.0.
2.0.1
- Update to
package:uuidversion 2.0.
2.0.0
- No longer expose
closeandonCloseon anSseConnection. This is simply handled by the underlyingstream/sink. - Fix a bug where resources of the
SseConnectionwere not properly closed.
1.0.0
- Internal cleanup.
0.0.1
- Initial commit.
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'sse:4.2.0'pubspec.yaml
name: sse
version: 4.2.0
description: >-
Provides client and server functionality for setting up bi-directional
communication through Server Sent Events (SSE) and corresponding POST
requests.
repository: https://github.com/dart-lang/tools/tree/main/pkgs/sse
issue_tracker: https://github.com/dart-lang/tools/labels/package%3Asse
environment:
sdk: ^3.11.0
dependencies:
async: ^2.0.8
collection: ^1.0.0
logging: ^1.0.0
pool: ^1.5.0
shelf: ^1.1.0
stream_channel: ^2.0.0
web: '>=0.5.0 <2.0.0'
dev_dependencies:
dart_flutter_team_lints: ^3.0.0
shelf_static: ^1.0.0
test: ^1.16.6
webdriver: ^3.0.0
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 0.0.1 | On demand | Download | 792639c4…682ce6 |
| 1.0.0 | On demand | Download | 74233c17…abc86a |
| 2.0.0 | On demand | Download | 845fd5ef…0e78b0 |
| 2.0.1 | On demand | Download | db2c16af…2cf52f |
| 2.0.2 | On demand | Download | f1c8c1c6…679320 |
| 2.0.3 | On demand | Download | d189811f…1793ce |
| 2.1.0 | On demand | Download | 7fcfe133…d2c16b |
| 2.1.1 | On demand | Download | c51bf8ee…3ffd44 |
| 2.1.2 | On demand | Download | d0b70e48…14d245 |
| 3.0.0 | On demand | Download | b2c63fc9…78c991 |
| 3.1.0 | On demand | Download | cf33a128…a40646 |
| 3.1.1 | On demand | Download | 939999dd…fc3acf |
| 3.1.2 | On demand | Download | a508efe6…9cfd91 |
| 3.2.0 | On demand | Download | 21e6d65c…68f9e5 |
| 3.2.1 | On demand | Download | 0834892e…d3284e |
| 3.2.2 | On demand | Download | 7e6e4173…8e5824 |
| 3.3.0 | On demand | Download | 8d1f67a3…4f782c |
| 3.4.0 | On demand | Download | 0d538783…34a7ff |
| 3.5.0 | On demand | Download | a0930b95…b02457 |
| 3.6.0 | On demand | Download | a260e59a…7c54a1 |
| 3.6.1 | On demand | Download | 5266f3b8…cce5c7 |
| 3.7.0 | On demand | Download | 58b19d46…a3a50f |
| 3.8.0 | On demand | Download | 989dd04b…3221c4 |
| 3.8.1 | On demand | Download | de5eae4f…e8098c |
| 3.8.3 | On demand | Download | 4618734b…a5f889 |
| 4.0.0 | On demand | Download | d7e0174a…11da65 |
| 4.1.0 | On demand | Download | b08bb562…ad22b7 |
| 4.1.1 | On demand | Download | 2d7c94b8…438d5c |
| 4.1.2 | On demand | Download | 3ff9088c…b59442 |
| 4.1.3 | On demand | Download | d1153185…15ca62 |
| 4.1.4 | On demand | Download | 8168874c…c5319c |
| 4.1.5 | On demand | Download | fdce3a4a…1638f0 |
| 4.1.6 | On demand | Download | 111a0584…0bb89a |
| 4.1.7 | On demand | Download | 4389a01d…7ee32b |
| 4.1.8 | On demand | Download | fcc97470…603643 |
| 4.2.0 | Cached · Upstream SHA-256 matched | Download | a9a804db…c52302 |
Dependencies
async "^2.0.8"
collection "^1.0.0"
logging "^1.0.0"
pool "^1.5.0"
shelf "^1.1.0"
stream_channel "^2.0.0"
web "\u003e=0.5.0 \u003c2.0.0"