publish method

  1. @override
void publish(
  1. String subject,
  2. Uint8List data, {
  3. Map<String, String>? arguments,
  4. String? originId,
  5. String? replyTo,
})
override

Publishes a message. Throws TransportServerUnavailableException when the connection is not established. replyTo names the subject a response must be published to; it is a wire subject, not a local topic.

Implementation

@override
void publish(
  String subject,
  Uint8List data, {
  Map<String, String>? arguments,
  String? originId,
  String? replyTo,
}) {
  if (!isConnected) {
    throw TransportServerUnavailableException(subject);
  }
  publishes.add(
    FakeTransportPublish(subject, data, arguments, originId, replyTo),
  );
}