| 123 | } |
| 124 | |
| 125 | pub fn new_with_runtime( |
| 126 | durability: impl spacetimedb_durability::Durability<TxData = Txdata> + 'static, |
| 127 | disk_size: impl Fn() -> io::Result<SizeOnDisk> + Send + Sync + 'static, |
| 128 | snapshots: Option<SnapshotWorker>, |
| 129 | runtime: Handle, |
| 130 | ) -> Self { |
| 131 | Self { |
| 132 | durability: Arc::new(durability), |
| 133 | disk_size: Arc::new(disk_size), |
| 134 | snapshots, |
| 135 | runtime, |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | /// If snapshots are enabled, get the [SnapshotRepo] they are stored in. |
| 140 | pub fn snapshot_repo(&self) -> Option<Arc<DynSnapshotRepo>> { |