shelf_eventsource 0.1.0+1 copy "shelf_eventsource: ^0.1.0+1" to clipboard
shelf_eventsource: ^0.1.0+1 copied to clipboard

Dart 1 only

A shelf handler for Server-Sent Events (SSE).

shelf_eventsource #

A shelf extension for EventSource or Server-Sent Events (SSE) that works together with the eventsource package.

How to use it? #

The usage is really easy:

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.

0
likes
30
pub points
10%
popularity

Publisher

unverified uploader

A shelf handler for Server-Sent Events (SSE).

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

eventsource, shelf, stream_channel

More

Packages that depend on shelf_eventsource