req method

VoidCallback req(
  1. TTMsg msg,
  2. TTMsgCb? cb
)

Send a message that expects responses via @

@param msg @param cb

Implementation

VoidCallback req(TTMsg msg, TTMsgCb? cb) {
  final String reqId = msg.key = msg.key ?? generateMessageId();
  if (!isNull(cb)) {
    _callbacks[reqId] = cb!;
  }
  send([msg]);
  return () {
    off(reqId);
  };
}