Interface for collections of objects retrieved from the RedDot server with transparent caching. If caching is enabled the list of objects is retrieved from the server and subsequent access is done on the cache of this list. If caching is disabled the list of objects is retrieved from the server every time it gets accessed.
More...
|
T | GetByPosition (int pos) |
| Get an element of the list at a specific position.
|
|
ICachedList< T > | Refreshed () |
| Calls Refresh() and returns this.
|
|
void | WaitFor (Predicate< ICachedList< T >> predicate, TimeSpan wait, TimeSpan retryPeriod) |
| Waits until a predicate on itself becomes true. Every retry period Refresh() is called and the predicate evaluated again, until the predicate evaluates to true, or the wait timespan is exhausted.
|
|
void | InvalidateCache () |
| Clear the cache and refresh it on the next access.
|
|
void | Refresh () |
| Updates the cache immediatly.
|
|
Interface for collections of objects retrieved from the RedDot server with transparent caching. If caching is enabled the list of objects is retrieved from the server and subsequent access is done on the cache of this list. If caching is disabled the list of objects is retrieved from the server every time it gets accessed.
- Template Parameters
-
T | TypeId of objects in the list |
Definition at line 25 of file ICachedList.cs.
T erminas.SmartAPI.Utils.CachedCollections.ICachedList< out T >.GetByPosition |
( |
int |
pos | ) |
|
Get an element of the list at a specific position.
- Parameters
-
pos | Position of the element in the list |
- Returns
- Element at position pos
- Exceptions
-
ArgumentOutOfRangeException | Thrown, if pos is not a valid index> |
ICachedList<T> erminas.SmartAPI.Utils.CachedCollections.ICachedList< out T >.Refreshed |
( |
| ) |
|
void erminas.SmartAPI.Utils.CachedCollections.ICachedList< out T >.WaitFor |
( |
Predicate< ICachedList< T >> |
predicate, |
|
|
TimeSpan |
wait, |
|
|
TimeSpan |
retryPeriod |
|
) |
| |
Waits until a predicate on itself becomes true. Every retry period Refresh() is called and the predicate evaluated again, until the predicate evaluates to true, or the wait timespan is exhausted.
Wait for a maximum of 5 seconds until a page with id 5 is included in the list, recheck the list every second:
ICachedList<Page> list = ...;
list.WaitFor(list=>list.FirstOrDefault(page=>page.Id == 5) != null, new TimeSpan(0,0,5), new TimeSpan(0,0,1));
- Exceptions
-
TimeoutException | Thrown if the predicate didn't evaluate to true in the given amount of time |
int erminas.SmartAPI.Utils.CachedCollections.ICachedList< out T >.Count |
|
get |
bool erminas.SmartAPI.Utils.CachedCollections.ICachedList< out T >.IsCachingEnabled |
|
getset |
True == caching is enabled False == caching is disabled
Definition at line 40 of file ICachedList.cs.
The documentation for this interface was generated from the following file: