send method

Future<void> send(
  1. ClientMsg msg
)

Implementation

Future<void> send(ClientMsg msg) async {
  bool rdy = await isReady();
  if (!rdy) {
    throw Exception("Websocket not ready, unable to send message $url");
  }

  dynamic msgToSend = msg.toJson();
  String encodedMsg = jsonEncode(msgToSend);
  _channel!.sink.add(encodedMsg);
  Logger.log.d("🔼 send message to $url: $msgToSend");
  // link relay to request
}