startLiveReloadWebSocketServer function
Starts a WebSocket server which will send a reloadSignal to all of its client when succeededBuild
emits.
If you want to take control over the WebSocketChannel
, consider using startWebSocketServer.
Implementation
void startLiveReloadWebSocketServer(Uri uri, Stream<Null> succeededBuild) {
succeededBuild = succeededBuild.asBroadcastStream();
startWebSocketServer(uri).listen((channel) {
succeededBuild.listen((_) {
channel.sink.add(reloadSignal);
});
});
}