Skip to content

stevenroose/dart-shelf_eventsource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages