close method

Future<void> close(
  1. String path
)

Implementation

Future<void> close(String path) async {
  final normalizedPath = _normalizeSyncPath(path);
  if (!_connectedDocuments.containsKey(normalizedPath)) {
    throw RoomServerException("Not connected to $normalizedPath");
  }

  final doc = _connectedDocuments[normalizedPath];
  doc!.count--;
  if (doc.count == 0) {
    _connectedDocuments.remove(normalizedPath);
    await room.sendRequest("room.disconnect", {"path": normalizedPath});
    DocumentRuntime.instance!.unregisterDocument(doc.ref);
  }
}