Click or drag to resize

IGlobalCache Methods

The IGlobalCache type exposes the following members.

Methods
  NameDescription
Public methodAwaitCondition
Wait for a given condition to be satisfied before returning. This method blocks the current thread until the provided function evaluates to true. Therefore, special care must be taken when defining the function (condition parameter) to avoid a deadlock condition.
Public methodAwaitConditionAsync
Asynchronously wait for a given condition to be satisfied. The returned task will not complete until the provided function evaluates to true. When called from an asynchronous method, this method allows synchronization of DataConveyer processing without thread blocking.
Public methodAwaitSignal
Wait for a given signal to be raised before returning. This method blocks the current thread until the given signal is raised. Therefore, special care must be taken to assure that the RaiseSignal(String) method is called on another thread, so that a deadlock condition is avoided.
Public methodAwaitSignalAsync
Asynchronously wait for a given signal to be raised. The returned task will not complete until the given signal is raised using the RaiseSignal(String) method. When called from an asynchronous method, this method allows synchronization of DataConveyer processing without thread blocking.
Public methodIncrementValue(String)
Add 1 to an integer value held in GlobalCache. This method is thread-safe.
Public methodIncrementValue(String, Int32)
Add a given number to an integer value held in GlobalCache. This method is thread-safe.
Public methodRaiseSignal
Raise a signal that another part (thread) of DataConveyer process might be waiting for. Once this method is called, any method held by either the AwaitSignal(String) or AwaitSignalAsync(String) method will continue execution.
Public methodReplaceValueTIn, TOut
Replace value for a given key based on a given calculation formula.
Public methodTryGet
Attempt to retrieve the current value for a given key.
Public methodTryReplace
Attempt to replace the value for a given key. This method is thread-safe. Note that there is no guarantee that any call to TryReplace method will succeed; it will fail (return false) if another thread changed the underlying value (oldValue). To guarantee a successful replacement, TryGet and TryReplace methods need to be called in a loop until TryReplace returns true. Alternatively, ReplaceValue method may be called, which executes such loop internally.
Top
See Also