aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Util/FSTDispatchQueue.h
diff options
context:
space:
mode:
authorGravatar Sebastian Schmidt <mrschmidt@google.com>2017-10-30 18:17:16 -0700
committerGravatar GitHub <noreply@github.com>2017-10-30 18:17:16 -0700
commit02ff6bbee95150eacff9563af4dd7a6e1aeaebdd (patch)
tree8a095ae29bdb6daf273f57913af021c2eae981ab /Firestore/Source/Util/FSTDispatchQueue.h
parent1db9fd83df8d29abe5e7369ad1cbf3eb8545a78a (diff)
Closing the write and watch stream after 60s of idleness (#388)
Diffstat (limited to 'Firestore/Source/Util/FSTDispatchQueue.h')
-rw-r--r--Firestore/Source/Util/FSTDispatchQueue.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/Firestore/Source/Util/FSTDispatchQueue.h b/Firestore/Source/Util/FSTDispatchQueue.h
index 256b9c0..fe87887 100644
--- a/Firestore/Source/Util/FSTDispatchQueue.h
+++ b/Firestore/Source/Util/FSTDispatchQueue.h
@@ -23,6 +23,8 @@ NS_ASSUME_NONNULL_BEGIN
/** Creates and returns an FSTDispatchQueue wrapping the specified dispatch_queue_t. */
+ (instancetype)queueWith:(dispatch_queue_t)dispatchQueue;
+- (instancetype)initWithQueue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER;
+
- (instancetype)init __attribute__((unavailable("Use static constructor method.")));
/**
@@ -50,6 +52,17 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)dispatchAsyncAllowingSameQueue:(void (^)(void))block;
+/**
+ * Schedules a callback after the specified delay.
+ *
+ * Unlike dispatchAsync: this method does not require you to dispatch to a different queue than
+ * the current one (thus it is equivalent to a raw dispatch_after()).
+ *
+ * @param block The block to run.
+ * @param delay The delay (in seconds) after which to run the block.
+ */
+- (void)dispatchAfterDelay:(NSTimeInterval)delay block:(void (^)(void))block;
+
/** The underlying wrapped dispatch_queue_t */
@property(nonatomic, strong, readonly) dispatch_queue_t queue;