aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Core/FSTListenSequence.h
diff options
context:
space:
mode:
authorGravatar Greg Soltis <gsoltis@google.com>2018-01-17 12:23:45 -0800
committerGravatar GitHub <noreply@github.com>2018-01-17 12:23:45 -0800
commit70d401d4837c7ff76531e74d2f363783e651bd4e (patch)
tree5b7176d5a0e18375cbc37e20a673c110d0556b43 /Firestore/Source/Core/FSTListenSequence.h
parentb341356be10ab6860a021e0c4da4a1158f40ca8f (diff)
Listen sequence numbers (#675)
* Generate and save sequence numbers for listens * Add documentation * Fix include path * Fix unavailable comment * Review feedback
Diffstat (limited to 'Firestore/Source/Core/FSTListenSequence.h')
-rw-r--r--Firestore/Source/Core/FSTListenSequence.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/Firestore/Source/Core/FSTListenSequence.h b/Firestore/Source/Core/FSTListenSequence.h
new file mode 100644
index 0000000..56d0e78
--- /dev/null
+++ b/Firestore/Source/Core/FSTListenSequence.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2018 Google
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#import <Foundation/Foundation.h>
+
+#import "FSTTypes.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ * FSTListenSequence is a monotonic sequence. It is initialized with a minimum value to
+ * exceed. All subsequent calls to next will return increasing values.
+ */
+@interface FSTListenSequence : NSObject
+
+- (instancetype)initStartingAfter:(FSTListenSequenceNumber)after NS_DESIGNATED_INITIALIZER;
+
+- (id)init NS_UNAVAILABLE;
+
+- (FSTListenSequenceNumber)next;
+
+@end
+
+NS_ASSUME_NONNULL_END \ No newline at end of file