Link to home
Start Free TrialLog in
Avatar of Phreak3eb
Phreak3eb

asked on

Threading a Timer Object

I'm writing a Windows service in C# that needs to periodically, e.g. every minute, check a POP3 mailbox and grab some emails.  The problem being, is that it may take longer than a minute for it to complete processing.  I've been doing some digging on the net and EE on how I might do this and have come up empty.  Here's what I need:

A timer object to fire every 1-5 minutes and start a new thread if needed to do the processing.
Avatar of sabeesh
sabeesh
Flag of United States of America image

Instead of timer user thread. so you can manage each thread separately and you set time interval for thread also.
Instead of timer use thread. so you can manage each thread separately and you set time interval for thread also.
Avatar of Phreak3eb
Phreak3eb

ASKER

Could you give a little more detail?  I guess I don't understand what you mean...?
ASKER CERTIFIED SOLUTION
Avatar of gregoryyoung
gregoryyoung
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just use boolean flag to say the job isn't done yet and that it will be for the next 3 minutes.
Thanks for all of your help.  Both solutions from Idle Mind and gregoryyoung will work and give me a couple options to work with.