//import 'package:some_http_package/some_http_package.dart'; // Replace with actual HTTP package abstract class Broadcaster { /// Authenticate the incoming request for a given channel. /// /// @param Request request /// @return mixed Future auth(Request request); /// Return the valid authentication response. /// /// @param Request request /// @param mixed result /// @return mixed Future validAuthenticationResponse(Request request, dynamic result); /// Broadcast the given event. /// /// @param List channels /// @param String event /// @param Map payload /// @return void /// /// @throws BroadcastException Future broadcast(List channels, String event, {Map payload = const {}}); } class BroadcastException implements Exception { final String message; BroadcastException(this.message); @override String toString() => 'BroadcastException: $message'; } // TODO: Find dart library to replace symfony for Request Class.