MCPcopy Index your code
hub / github.com/pyscript/pyscript / sync

Method sync

core/src/stdlib/pyscript/storage.py:185–204  ·  view source on GitHub ↗

Force immediate synchronization to IndexedDB. By default, storage operations are queued and written asynchronously. Call `sync()` when you need to guarantee changes are persisted immediately, such as before critical operations or page unload. ```python

(self)

Source from the content-addressed store, hash-verified

183 super().clear()
184
185 async def sync(self):
186 """
187 Force immediate synchronization to IndexedDB.
188
189 By default, storage operations are queued and written asynchronously.
190 Call `sync()` when you need to guarantee changes are persisted immediately,
191 such as before critical operations or page unload.
192
193 ```python
194 store = await storage("important-data")
195 store["critical_value"] = data
196
197 # Ensure it's written before proceeding.
198 await store.sync()
199 ```
200
201 This is a blocking operation that waits for IndexedDB to complete
202 the write.
203 """
204 await self._store.sync()
205
206
207async def storage(name="", storage_class=Storage):

Callers 11

storageFunction · 0.80
syncFunction · 0.80
index.pyFile · 0.80
test_sync_unmounted_pathFunction · 0.80
setupFunction · 0.80
teardownFunction · 0.80
test_storage_typesFunction · 0.80
test_storage_persistenceFunction · 0.80

Calls

no outgoing calls

Tested by 8

test_sync_unmounted_pathFunction · 0.64
setupFunction · 0.64
teardownFunction · 0.64
test_storage_typesFunction · 0.64
test_storage_persistenceFunction · 0.64