RemoteClient.fromJsonChannel constructor
RemoteClient.fromJsonChannel(
- StreamChannel<
Map< channel,String, Object?> > - CloseWithReason closeWithReason,
- String protocol
Implementation
RemoteClient.fromJsonChannel(
this.channel,
this.closeWithReason,
this.protocol,
) {
_ctrl.local.stream.map((m) => m.toJson()).forEach(channel.sink.add);
channel.stream.listen(
(m) => _ctrl.local.sink.add(OperationMessage.fromJson(m)),
onDone: _ctrl.local.sink.close,
);
}