Method Peek
Peek()
Returns the object at the beginning of the IQueue without removing it.
Declaration
T Peek()
Returns
Type | Description |
---|---|
T | The object at the beginning of the IQueue |
Examples
The following code sample shows how to get an object from the beginning of the distributed queue without removing it.
ICache cache = CacheManager.GetCache("demoClusteredCache");
string dataTypeName = "DistributedQueue";
IDistributedQueue<Product> queue = cache.DataTypeManager.GetQueue<Product>(dataTypeName);
Product product = queue.Peek();