publish method
Implementation
@override
Future<void> publish({
required String topic,
required String message,
required int ttl,
required int tag,
}) async {
_checkInitialized();
core.logger.i('[$runtimeType] publish, $topic, $message');
Map<String, dynamic> data = {
'message': message,
'ttl': ttl,
'topic': topic,
'tag': tag,
};
try {
await messageTracker.recordMessageEvent(topic, message);
var _ = await _sendJsonRpcRequest(
_buildMethod(JSON_RPC_PUBLISH),
data,
JsonRpcUtils.payloadId(entropy: 6),
);
} catch (e, s) {
core.logger.e('[$runtimeType], publish: $e', stackTrace: s);
onRelayClientError.broadcast(ErrorEvent(e));
}
}