reply method

void reply(
  1. String keyExpr,
  2. String value, {
  3. Encoding? encoding,
  4. ZBytes? attachment,
})

Sends a reply to this query with a string value.

The keyExpr should match the queryable's key expression. Optionally specify an encoding for the payload and a binary attachment carried alongside the reply sample.

Throws StateError if the query has been disposed. Throws ZenohException if the reply fails.

Implementation

void reply(
  String keyExpr,
  String value, {
  Encoding? encoding,
  ZBytes? attachment,
}) {
  _ensureNotDisposed();
  final zbytes = ZBytes.fromString(value);
  replyBytes(keyExpr, zbytes, encoding: encoding, attachment: attachment);
}