Member Junction
    Preparing search index...

    Interface CacheChangedEvent

    Describes a change to a cached entry, used for cross-server cache invalidation via Redis pub/sub. When one server updates a cache entry, this event is published so other servers can react (e.g., reload an engine's in-memory array).

    // Register a callback for a specific cache fingerprint
    const unsubscribe = LocalCacheManager.Instance.RegisterChangeCallback(
    fingerprint,
    (event: CacheChangedEvent) => {
    console.log(`Cache updated by server ${event.SourceServerId}`);
    // Refresh local data...
    }
    );

    // Later, to stop listening:
    unsubscribe();
    interface CacheChangedEvent {
        Action: "set" | "removed" | "category_cleared";
        CacheKey: string;
        Category: string;
        Data?: string;
        SourceServerId: string;
        Timestamp: number;
    }
    Index

    Properties

    Action: "set" | "removed" | "category_cleared"

    What happened to the cache entry.

    • 'set' — a new value was stored (create or replace)
    • 'removed' — a single key was deleted
    • 'category_cleared' — all keys in the category were deleted
    CacheKey: string

    The cache key that changed. For RunView results, this is the fingerprint generated by LocalCacheManager.GenerateRunViewFingerprint (format: EntityName|Filter|OrderBy|MaxRows|StartRow|AggHash[|Connection]).

    Category: string

    The storage category of the changed entry. One of: 'RunViewCache', 'RunQueryCache', 'DatasetCache', 'Metadata', 'default'.

    Data?: string

    The new cached value as a JSON string, included in the event to avoid a round-trip back to Redis. Only present for 'set' actions. For 'removed' and 'category_cleared' actions, this is undefined.

    SourceServerId: string

    The MJGlobal.ProcessUUID of the server that made the change. Used to filter out self-originated events (a server doesn't need to react to its own mutations).

    Timestamp: number

    UTC Unix timestamp in milliseconds when the change occurred (Date.now()).