stevenroose / dart-eventsource

A client and server implementation of Server-Side Events.
MIT License
56 stars 49 forks source link

Add Eventsource.close() method #25

Open Skycoder42 opened 2 years ago

Skycoder42 commented 2 years ago

This PR simply adds the ability to close an event source. It does this by canceling any active connections to the server and then closes the internal controller to ensure all listeners receive the done event.

I also made sure that a cancellation while the event source is trying to reconnect leads to the reconnection being stopped.

Skycoder42 commented 2 years ago

This would also close #15 I think