using Umbraco.Cms.Core.Cache; namespace Umbraco.Cms.Core.Sync; /// /// Transmits distributed cache notifications for all servers of a load balanced environment. /// /// Also ensures that the notification is processed on the local environment. public interface IServerMessenger { /// /// Called to synchronize a server with queued notifications /// void Sync(); /// /// Called to send/commit the queued messages created with the Perform methods /// void SendMessages(); /// /// Notifies the distributed cache, for a specified . /// /// The ICacheRefresher. /// The notification content. void QueueRefresh(ICacheRefresher refresher, TPayload[] payload); /// /// Notifies the distributed cache of specified item invalidation, for a specified . /// /// The type of the invalidated items. /// The ICacheRefresher. /// A function returning the unique identifier of items. /// The invalidated items. void QueueRefresh(ICacheRefresher refresher, Func getNumericId, params T[] instances); /// /// Notifies the distributed cache of specified item invalidation, for a specified . /// /// The type of the invalidated items. /// The ICacheRefresher. /// A function returning the unique identifier of items. /// The invalidated items. void QueueRefresh(ICacheRefresher refresher, Func getGuidId, params T[] instances); /// /// Notifies all servers of specified items removal, for a specified . /// /// The type of the removed items. /// The ICacheRefresher. /// A function returning the unique identifier of items. /// The removed items. void QueueRemove(ICacheRefresher refresher, Func getNumericId, params T[] instances); /// /// Notifies all servers of specified items removal, for a specified . /// /// The ICacheRefresher. /// The unique identifiers of the removed items. void QueueRemove(ICacheRefresher refresher, params int[] numericIds); /// /// Notifies all servers of specified items invalidation, for a specified . /// /// The ICacheRefresher. /// The unique identifiers of the invalidated items. void QueueRefresh(ICacheRefresher refresher, params int[] numericIds); /// /// Notifies all servers of specified items invalidation, for a specified . /// /// The ICacheRefresher. /// The unique identifiers of the invalidated items. void QueueRefresh(ICacheRefresher refresher, params Guid[] guidIds); /// /// Notifies all servers of a global invalidation for a specified . /// /// The ICacheRefresher. void QueueRefreshAll(ICacheRefresher refresher); }