Hi guys I need to implement a way to timeout my objects without using a timer class that is base on specific timespan and last transaction date. Can anyone point a good implementation of this kind or a sample may be? By the way this is not a web application but a console app.
Edit 1:
Sorry I forgot to tell you guys some of my actual scenarios. I have different threads that produces objects that needs to be timeout if no events after x amount of time. I already have a working logic for this using timers but I wanted it to be more efficient and not use the threads on my thread pool ( since I’m using a timer then the object on WaitCallBack will be processed by an idle thread on my app domain thread pool ). I was thinking if I could just use a single thread to do this but I’m lost on how I will implement it. Hope some guys can out there can help me out thanks!
I have a feeling the Cache object may be able to help you out – even though it’s not a web app, you can still use it by adding a reference to System.Web, or if you’re in .NET 4, they’ve added it in System.Runtime.Caching.