YapDatabaseActionManager
@interface YapDatabaseActionManager : YapDatabaseAutoView
This extension automatically monitors the database for objects that support the YapActionable protocol.
Objects that support the YapActionable protocol relay information about actions
that need to be taken.
This information includes things such as:
- when the action needs to be taken
- if it should be retried, and if so what delay to use
- whether or not the action requires an Internet connection
- the block to invoke in order to trigger the action
This extension handles all aspects related to scheduling & executing YapActionItems.
Examples of YapActionItems include things such as:
- deleting items when they expire e.g.: removing cached files
- refreshing items when they’ve become
stale
e.g.: periodically updating user infromation from the server
-
Undocumented
Declaration
Objective-C
- (instancetype)init;
Swift
init()
-
Undocumented
Declaration
Objective-C
- (instancetype)initWithConnection:(nullable YapDatabaseConnection *)connection;
Swift
init(connection: YapDatabaseConnection?)
-
Undocumented
Declaration
Objective-C
- (instancetype)initWithConnection:(nullable YapDatabaseConnection *)connection options:(nullable YapDatabaseViewOptions *)options;
Swift
init(connection: YapDatabaseConnection?, options: YapDatabaseViewOptions?)
-
Undocumented
Declaration
Objective-C
- (instancetype)initWithConnection:(nullable YapDatabaseConnection *)connection options:(nullable YapDatabaseViewOptions *)options scheduler:(nullable YapActionScheduler)scheduler;
Swift
init(connection: YapDatabaseConnection?, options: YapDatabaseViewOptions?, scheduler: YapActionScheduler? = nil)
-
YapDatabaseActionManager relies on a reachability instance to monitory for internet connectivity. This is to support the YapActionItem.requiresInternet property.
If an instance is not assigned, then one will be automatically created (after registration) via [YapReachability reachabilityForInternetConnection].
Declaration
Objective-C
@property (readwrite, strong, atomic, nullable) YapReachability *reachability;
Swift
var reachability: YapReachability? { get set }
-
Returns YES if the action manager is suspended.
See
suspendSee
resumeDeclaration
Objective-C
@property (readonly, atomic) BOOL isSuspended;
Swift
var isSuspended: Bool { get }
-
Returns the current suspendCount. If the suspendCount is zero, that means isSuspended == NO; if the suspendCount is non-zero, that means isSuspended == YES;
See
suspendSee
resumeDeclaration
Objective-C
@property (readonly, atomic) NSUInteger suspendCount;
Swift
var suspendCount: UInt { get }
-
Increments the suspendCount by 1.
@return The new suspend count.
Declaration
Objective-C
- (NSUInteger)suspend;
Swift
func suspend() -> UInt
-
This method operates the same as invoking the suspend method the given number of times. That is, it increments the suspend count by the given number.
@return The new suspend count.
See
suspendSee
suspendCountDeclaration
Objective-C
- (NSUInteger)suspendWithCount:(NSUInteger)suspendCountIncrement;
Swift
func suspend(withCount suspendCountIncrement: UInt) -> UInt
-
See the suspend method for a description of the suspend/resume architecture.
@return The new suspend count.
Declaration
Objective-C
- (NSUInteger)resume;
Swift
func resume() -> UInt