Definition at line 135 of file WriteTracker.py.
◆ __init__()
| selfie_lib.WriteTracker.WriteTracker.__init__ |
( |
| self | ) |
|
Definition at line 136 of file WriteTracker.py.
136 def __init__(self):
137 self.lock = threading.Lock()
138 self.writes: dict[T, FirstWrite[U]] = {}
139
◆ recordInternal()
| selfie_lib.WriteTracker.WriteTracker.recordInternal |
( |
| self, |
|
|
T | key, |
|
|
U | snapshot, |
|
|
CallStack | call, |
|
|
SnapshotFileLayout | layout, |
|
|
bool | allow_multiple_equivalent_writes = True ) |
Definition at line 140 of file WriteTracker.py.
147 ):
148 with self.lock:
149 this_write = FirstWrite(snapshot, call)
150 if key not in self.writes:
151 self.writes[key] = this_write
152 return
153
154 existing = self.writes[key]
155 if existing.snapshot != snapshot:
156 raise ValueError(
157 f"Snapshot was set to multiple values!\n first time: {existing.call_stack.location.ide_link(layout)}\n this time: {call.location.ide_link(layout)}"
158 )
159 elif not allow_multiple_equivalent_writes:
160 raise ValueError("Snapshot was set to the same value multiple times.")
161
162
◆ lock
| selfie_lib.WriteTracker.WriteTracker.lock = threading.Lock() |
◆ writes
| dict selfie_lib.WriteTracker.WriteTracker.writes = {} |
The documentation for this class was generated from the following file: