Click or drag to resize

InterprocessCache Class

Represents a serialized data cache that can be saved or read from multiple applications using inter-process synchronization.
Inheritance Hierarchy

Namespace: GSF.IO
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.181-beta
Syntax
public class InterprocessCache : IDisposable
View Source

The InterprocessCache type exposes the following members.

Constructors
 NameDescription
Public methodInterprocessCache Creates a new instance of the InterprocessCache.
Public methodInterprocessCache(Int32) Creates a new instance of the InterprocessCache with the specified number of maximumConcurrentLocks.
Top
Properties
 NameDescription
Public propertyAutoSave Gets or sets flag that determines if InterprocessCache should automatically initiate a save when FileData has been updated.
Public propertyFileData Gets or sets file data for the cache to be saved or that has been loaded.
Public propertyFileName Path and file name for the cache needing inter-process synchronization.
Public propertyMaximumConcurrentLocks Gets the maximum concurrent reader locks allowed.
Public propertyMaximumRetryAttempts Maximum retry attempts allowed for loading or saving cache file data.
Public propertyReloadOnChange Gets or sets flag that enables system to monitor for changes in FileName and automatically reload FileData.
Public propertyRetryDelayInterval Wait interval, in milliseconds, before retrying load or save of cache file data.
Top
Methods
 NameDescription
Public methodDispose Releases all the resources used by the InterprocessCache object.
Protected methodDispose(Boolean) Releases the unmanaged resources used by the InterprocessCache object and optionally releases the managed resources.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalize Releases the unmanaged resources before the InterprocessCache object is reclaimed by GC.
(Overrides ObjectFinalize)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodLoad Initiates inter-process synchronized cache file load.
Protected methodLoadFileData Handles deserialization of file from disk; virtual method allows customization (e.g., pre-load decryption and/or data merge).
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodSave Initiates inter-process synchronized cache file save.
Protected methodSaveFileData Handles serialization of file to disk; virtual method allows customization (e.g., pre-save encryption and/or data merge).
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Public methodWaitForLoad Blocks current thread and waits for any pending load to complete; wait time is RetryDelayInterval * MaximumRetryAttempts.
Public methodWaitForLoad(Int32) Blocks current thread and waits for specified millisecondsTimeout for any pending load to complete.
Public methodWaitForSave Blocks current thread and waits for any pending save to complete; wait time is RetryDelayInterval * MaximumRetryAttempts.
Public methodWaitForSave(Int32) Blocks current thread and waits for specified millisecondsTimeout for any pending save to complete.
Top
Fields
 NameDescription
Public fieldStatic memberDefaultMaximumRetryAttempts Default maximum retry attempts allowed for loading InterprocessCache.
Public fieldStatic memberDefaultRetryDelayInterval Default wait interval, in milliseconds, before retrying load of InterprocessCache.
Top
Extension Methods
 NameDescription
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Top
Remarks
Note that all file data in this class gets serialized to and from memory, as such, the design intention for this class is for use with smaller data sets such as serialized lists or dictionaries that need inter-process synchronized loading and saving.
See Also