开发者

Read Item in Queue<T> before Dequeueing

开发者 https://www.devze.com 2023-02-19 15:08 出处:网络
I have a Queue<T> In my T I have a DateLoaded property. I want to say if开发者_JAVA百科 the DateLoaded is older than 5 minutes dequeue it and execute code on T

I have a Queue<T>

In my T I have a DateLoaded property.

I want to say if开发者_JAVA百科 the DateLoaded is older than 5 minutes dequeue it and execute code on T

Is this possible?


Use the Peek() method.


You can call Peek to look at what the first element in the queue is.

0

精彩评论

暂无评论...
验证码 换一张
取 消