PhoenixChannel.fromSocket constructor
PhoenixChannel.fromSocket(
- PhoenixSocket socket, {
- required String topic,
- Map<
String, dynamic> ? parameters, - Duration? timeout,
Build a PhoenixChannel from a PhoenixSocket.
Implementation
PhoenixChannel.fromSocket(
this.socket, {
required this.topic,
Map<String, dynamic>? parameters,
Duration? timeout,
}) : _controller = StreamController.broadcast(),
_waiters = {},
parameters = parameters ?? {},
_timeout = timeout ?? socket.defaultTimeout {
_joinPush = _prepareJoin();
_logger = Logger('phoenix_socket.channel.$loggerName');
_subscriptions
..add(_controller.stream.listen(_onMessage))
..addAll(_subscribeToSocketStreams(socket));
}