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
  • Returns YES if the action manager is suspended.

    See

    suspend

    See

    resume

    Declaration

    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

    suspend

    See

    resume

    Declaration

    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

    suspend

    See

    suspendCount

    Declaration

    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