aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Local/FSTWriteGroupTracker.mm
diff options
context:
space:
mode:
Diffstat (limited to 'Firestore/Source/Local/FSTWriteGroupTracker.mm')
-rw-r--r--Firestore/Source/Local/FSTWriteGroupTracker.mm11
1 files changed, 11 insertions, 0 deletions
diff --git a/Firestore/Source/Local/FSTWriteGroupTracker.mm b/Firestore/Source/Local/FSTWriteGroupTracker.mm
index 7e3bf60..2cb10bd 100644
--- a/Firestore/Source/Local/FSTWriteGroupTracker.mm
+++ b/Firestore/Source/Local/FSTWriteGroupTracker.mm
@@ -40,6 +40,17 @@ NS_ASSUME_NONNULL_BEGIN
return self.activeGroup;
}
+- (FSTWriteGroup *)startGroupWithAction:(NSString *)action
+ transaction:
+ (firebase::firestore::local::LevelDbTransaction *)transaction {
+ // NOTE: We can relax this to allow nesting if/when we find we need it.
+ FSTAssert(!self.activeGroup,
+ @"Attempt to create write group (%@) while existing write group (%@) still active.",
+ action, self.activeGroup.action);
+ self.activeGroup = [FSTWriteGroup groupWithAction:action transaction:transaction];
+ return self.activeGroup;
+}
+
- (void)endGroup:(FSTWriteGroup *)group {
FSTAssert(self.activeGroup == group,
@"Attempted to end write group (%@) which is different from active group (%@)",