Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stevenroose/dart-shelf_eventsource
A shelf handler for Server-Side Events (SSE).
https://github.com/stevenroose/dart-shelf_eventsource
Last synced: 3 months ago
JSON representation
A shelf handler for Server-Side Events (SSE).
- Host: GitHub
- URL: https://github.com/stevenroose/dart-shelf_eventsource
- Owner: stevenroose
- License: mit
- Created: 2016-11-27T20:39:33.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-11-14T21:54:26.000Z (about 2 years ago)
- Last Synced: 2024-10-09T22:11:53.340Z (4 months ago)
- Language: Dart
- Size: 3.91 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# shelf_eventsource
A shelf extension for EventSource or Server-Sent Events (SSE) that works together with the
[eventsource](https://pub.dartlang.org/packages/eventsource) package.# How to use it?
The usage is really easy:
```dart
import "package:shelf/shelf_io.dart" as io;
import "package:eventsource/publisher.dart";
import "package:shelf_eventsource/shelf_eventsource.dart";EventSourcePublisher publisher = new EventSourcePublisher(cacheCapacity: 100);
var handler = eventSourceHandler(publisher);
io.serve(handler, "localhost", 8080);
```
For a more extensive example with routing, see the `example/` directory.## Licensing
This project is available under the MIT license, as can be found in the LICENSE file.