update method

  1. @override
Future<void> update(
  1. String topic, {
  2. int? expiry,
  3. Map<String, Namespace>? namespaces,
  4. TransportType? transportType,
})
override

Implementation

@override
Future<void> update(
  String topic, {
  int? expiry,
  Map<String, Namespace>? namespaces,
  TransportType? transportType,
}) async {
  checkInitialized();

  SessionData? info = get(topic);
  if (info == null) {
    return;
  }

  if (expiry != null) {
    info = info.copyWith(expiry: expiry);
  }
  if (namespaces != null) {
    info = info.copyWith(namespaces: namespaces);
  }
  if (transportType != null) {
    info = info.copyWith(transportType: transportType);
  }

  await set(topic, info);
}