Home All Groups Group Topic Archive Search About

Periodic housekeeping code strategy?

Author
5 Sep 2006 2:14 AM
Bill
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

Author
5 Sep 2006 4:12 AM
Greg Young
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
Author
6 Sep 2006 12:20 PM
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
>
>
Author
6 Sep 2006 2:06 PM
Carl Daniel [VC++ MVP]
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
Author
7 Sep 2006 1:07 PM
Ben Voigt
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.

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?

Show quote
>
> -cd
>
>
Author
9 Sep 2006 1:13 AM
Bill
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
>>
>>
>
>
Author
13 Sep 2006 8:38 PM
Bill
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
>
>

AddThis Social Bookmark Button