IGlobalCache Methods |
The IGlobalCache type exposes the following members.
Name | Description | |
---|---|---|
AwaitCondition |
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.
| |
AwaitConditionAsync |
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.
| |
AwaitSignal |
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.
| |
AwaitSignalAsync |
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.
| |
IncrementValue(String) |
Add 1 to an integer value held in GlobalCache. This method is thread-safe.
| |
IncrementValue(String, Int32) |
Add a given number to an integer value held in GlobalCache. This method is thread-safe.
| |
RaiseSignal |
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.
| |
ReplaceValueTIn, TOut |
Replace value for a given key based on a given calculation formula.
| |
TryGet |
Attempt to retrieve the current value for a given key.
| |
TryReplace |
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.
|