close method

Future<void> close(
  1. String path
)

Implementation

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

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