ForceFlushable

public protocol ForceFlushable : MoEngageStorage.Flushable

A type that supports both a deferred flush and an immediate force-flush.

Extends Flushable with a flush(force:inInstance:) variant that can bypass the normal scheduling delay and write to the backing store right away. Typically conformed to by cache types (e.g. MoEngageStorage/FileStorage/State) that schedule deferred writes but must also support urgent persistence before app suspension or logout.

  • Persists the current in-memory value to the backing store.

    Declaration

    Swift

    func flush(force: Bool, inInstance sdkInstance: isolated MoEngageSDKInstance) throws

    Parameters

    force

    When true, writes immediately regardless of any pending scheduled flush; when false, the implementation may apply its normal deferral policy.

    sdkInstance

    The isolated SDK instance providing path and configuration context.