sse 3.5.0

  • Readme
  • Changelog
  • Installing
  • 97

This package provides support for bi-directional communication through Server Sent Events and corresponding POST requests.

3.5.0 #

  • Add new shutdown methods on SseHandler and SseConnection to allow closing connections immediately, ignoring any keep-alive periods.

3.4.0 #

  • Remove onClose from SseConnection and ensure the corresponding sink.close correctly fires.

3.3.0 #

  • Add an onClose event to the SseConnection. This allows consumers to listen to this event in lue of sseConnection.sink.done as that is not guaranteed to fire.

3.2.2 #

  • Fix an issue where keepAlive may cause state errors when attempting to send messages on a closed stream.

3.2.1 #

  • Fix an issue where keepAlive would only allow a single reconnection.

3.2.0 #

  • Re-expose isInKeepAlivePeriod flag on SseConnection. This flag will be true when 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 SseClient would not send a done event when there was an error with the SSE connection.

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 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:http dependency.

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:uuid version 2.0.

2.0.0 #

  • No longer expose close and onClose on an SseConnection. This is simply handled by the underlying stream / sink.
  • Fix a bug where resources of the SseConnection were not properly closed.

1.0.0 #

  • Internal cleanup.

0.0.1 #

  • Initial commit.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  sse: ^3.5.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:sse/client/sse_client.dart';
import 'package:sse/server/sse_handler.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
94
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
97
Learn more about scoring.

We analyzed this package on Jun 5, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.2
  • pana: 0.13.8-dev

Maintenance suggestions

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and sse.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
async ^2.0.8 2.4.1
logging ^0.11.3+2 0.11.4
pedantic ^1.4.0 1.9.0
shelf ^0.7.4 0.7.5
stream_channel >=1.6.8 <3.0.0 2.0.0
uuid ^2.0.0 2.0.4
Transitive dependencies
charcode 1.1.3
collection 1.14.12
convert 2.1.1
crypto 2.1.5
http_parser 3.1.4
meta 1.1.8
path 1.7.0
source_span 1.7.0
stack_trace 1.9.3
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
shelf_static ^0.2.8
test ^1.5.3
webdriver ^2.1.0