MCPcopy
hub / github.com/marimo-team/marimo / run

Method run

marimo/_session/state/serialize.py:461–485  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

459 raise
460
461 async def run(self) -> None:
462 while self.running:
463 try:
464 if self.session_view.needs_export("session"):
465 self.session_view.mark_auto_export_session()
466 LOGGER.debug(f"Writing session view to cache {self.path}")
467 data = serialize_session_view(
468 self.session_view,
469 cell_ids=self.document.cell_ids,
470 script_metadata_hash=_script_metadata_hash(
471 self.notebook_path
472 ),
473 drop_virtual_file_outputs=True,
474 )
475 if isinstance(self.path, AsyncPath):
476 await self.path.write_text(json.dumps(data, indent=2))
477 else:
478 self.path.write_text(json.dumps(data, indent=2))
479 await asyncio.sleep(self.interval)
480 except asyncio.CancelledError:
481 raise
482 except Exception as e:
483 LOGGER.error(f"Write error: {e}")
484 # If we fail to write, we should stop the writer
485 break
486
487
488@dataclass

Callers 12

has_marimo_installedFunction · 0.45
install_marimo_into_venvFunction · 0.45
asyncio_runFunction · 0.45
validate_requirementsMethod · 0.45
validate_requirementsMethod · 0.45
startFunction · 0.45
open_in_editorMethod · 0.45
completionMethod · 0.45
_is_gpu_availableFunction · 0.45
_parse_nvidia_smi_statsFunction · 0.45
_parse_rocm_smi_statsFunction · 0.45

Calls 7

serialize_session_viewFunction · 0.85
_script_metadata_hashFunction · 0.85
needs_exportMethod · 0.80
debugMethod · 0.45
write_textMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected