|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Periodic housekeeping code strategy?I have a need to run a function on my dot net 2.0 web server every xx
minutes forever - whether or not a client is logged on. Anyone have suggestions or examples of good ways to do this? Thanks Bill Use a System.Thread.Timer that gets loaded when the app starts ? Personally
due to reasons of the app restarting etc I would make this a seperate service but this may work for you. Cheers, Greg Young MVP - C# http://codebetter.com/blogs/gregyoung Show quote "Bill" <B***@zz.com> wrote in message news:AC573BA6-B0CA-4BD9-A8F7-8861E857EEFB@microsoft.com... >I have a need to run a function on my dot net 2.0 web server every xx >minutes forever - whether or not a client is logged on. > > Anyone have suggestions or examples of good ways to do this? > > > Thanks > > Bill I think you are saying that a system.thread.timer will work but you prefer
something else. Can you expand on this a little - I'm not sure what you are recommending Thanks Bill Show quote "Greg Young" <druckdruckREMOVEgo***@hotmail.com> wrote in message news:OQ4VPGK0GHA.4408@TK2MSFTNGP05.phx.gbl... > Use a System.Thread.Timer that gets loaded when the app starts ? > Personally due to reasons of the app restarting etc I would make this a > seperate service but this may work for you. > > Cheers, > > Greg Young > MVP - C# > http://codebetter.com/blogs/gregyoung > > "Bill" <B***@zz.com> wrote in message > news:AC573BA6-B0CA-4BD9-A8F7-8861E857EEFB@microsoft.com... >>I have a need to run a function on my dot net 2.0 web server every xx >>minutes forever - whether or not a client is logged on. >> >> Anyone have suggestions or examples of good ways to do this? >> >> >> Thanks >> >> Bill > > Bill wrote:
> I think you are saying that a system.thread.timer will work but you Make and install a Windows Service that does your periodic housekeeping > prefer something else. > > Can you expand on this a little - I'm not sure what you are > recommending (perhaps by simply invoking one of your web services, or perhaps by working "behind the scenes", depending on exactly what that housekeeping is. See the System.ServiceProcess.ServiceBase class in the .NET framekwork SDK documentation for information on building a windows service in .NET. It's quite easy. -cd
Show quote
"Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@mvps.org.nospam> Why is everyone recommending re-inventing this wheel, when the cron wrote in message news:uBChj2b0GHA.772@TK2MSFTNGP05.phx.gbl... > Bill wrote: >> I think you are saying that a system.thread.timer will work but you >> prefer something else. >> >> Can you expand on this a little - I'm not sure what you are >> recommending > > Make and install a Windows Service that does your periodic housekeeping > (perhaps by simply invoking one of your web services, or perhaps by > working "behind the scenes", depending on exactly what that housekeeping > is. > > See the System.ServiceProcess.ServiceBase class in the .NET framekwork SDK > documentation for information on building a windows service in .NET. It's > quite easy. daemon -- oops I mean Scheduler service -- is perfectly suited for the task? Are there major security problems with the scheduler service so that no one will use it? Show quote > > -cd > > Ok
thanks Bill Show quote "Ben Voigt" <rbv@nospam.nospam> wrote in message news:uvh6g6n0GHA.4956@TK2MSFTNGP04.phx.gbl... > > "Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@mvps.org.nospam> > wrote in message news:uBChj2b0GHA.772@TK2MSFTNGP05.phx.gbl... >> Bill wrote: >>> I think you are saying that a system.thread.timer will work but you >>> prefer something else. >>> >>> Can you expand on this a little - I'm not sure what you are >>> recommending >> >> Make and install a Windows Service that does your periodic housekeeping >> (perhaps by simply invoking one of your web services, or perhaps by >> working "behind the scenes", depending on exactly what that housekeeping >> is. >> >> See the System.ServiceProcess.ServiceBase class in the .NET framekwork >> SDK documentation for information on building a windows service in .NET. >> It's quite easy. > > Why is everyone recommending re-inventing this wheel, when the cron > daemon -- oops I mean Scheduler service -- is perfectly suited for the > task? Are there major security problems with the scheduler service so that > no one will use it? > >> >> -cd >> >> > > I have been reading up on Windows Services and this looks like the way to go
but I am not how I can hook to my Web server code - if at all I need to run MyFunction() and although it would be easy for me to clone it in the Windows Service I would prefer to call the original if possible so I don't have another thing to compile each time I change the server code Is my .net web server code always accessible - is any of it always running or is it essentially dead untill activated by a web client? Thanks Bill Show quote "Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@mvps.org.nospam> wrote in message news:uBChj2b0GHA.772@TK2MSFTNGP05.phx.gbl... > Bill wrote: >> I think you are saying that a system.thread.timer will work but you >> prefer something else. >> >> Can you expand on this a little - I'm not sure what you are >> recommending > > Make and install a Windows Service that does your periodic housekeeping > (perhaps by simply invoking one of your web services, or perhaps by > working "behind the scenes", depending on exactly what that housekeeping > is. > > See the System.ServiceProcess.ServiceBase class in the .NET framekwork SDK > documentation for information on building a windows service in .NET. It's > quite easy. > > -cd > > |
|||||||||||||||||||||||