publish method

void publish(
  1. String topic,
  2. String message, {
  3. dynamic retain = false,
  4. dynamic qos = CommunicatorQos.atLeastOnce,
})

Implementation

void publish(String topic, String message,
    {retain = false, qos = CommunicatorQos.atLeastOnce}) {
  if (communicator == null) {
    _log.warning("Can't publish() before connect()");
    return;
  }

  _log.fine("publishing to $topic: $message (retain: $retain, qos: $qos)");
  communicator!.publish(topic, message, qos: qos, retain: retain);
}