Home All Groups Group Topic Archive Search About

Initiating Threads on IIS Start Up

Author
28 Feb 2006 2:50 PM
John
Hello,

We are trying to implement a solution for a project requirement for
which we need to have multiple services running to support offline
functionality such as the transmission of emails to subscribed users
and the publishing of content on specific schedules.  In doing this we
would like to re-use a lot of the libraries we have already built for
the web application and, more specifically, re-use all of the
configuration files which have already been established for the web
application.

One solution for this is to spawn threads within the Application_Start
event of the web application which will run continously and handle the
offline tasks at their set schedules.  This is probably the easiest
solution to implement, however the only problem is that these threads
will only be spawned when the first request is made to the web server.

Is there any other event trigger we could work off of that would be
executed when the web service restarts?  Also, are there any
complications we should expect in going with this solution, or are
there any better solutions we should be looking into?

Thanks in advance.

John Fleming

Author
28 Feb 2006 3:34 PM
John Bailo
It sounds like you should write a windows service instead of a web
application.

John wrote:
Show quote
> Hello,
>
> We are trying to implement a solution for a project requirement for
> which we need to have multiple services running to support offline
> functionality such as the transmission of emails to subscribed users
> and the publishing of content on specific schedules.  In doing this we
> would like to re-use a lot of the libraries we have already built for
> the web application and, more specifically, re-use all of the
> configuration files which have already been established for the web
> application.
>
> One solution for this is to spawn threads within the Application_Start
> event of the web application which will run continously and handle the
> offline tasks at their set schedules.  This is probably the easiest
> solution to implement, however the only problem is that these threads
> will only be spawned when the first request is made to the web server.
>
> Is there any other event trigger we could work off of that would be
> executed when the web service restarts?  Also, are there any
> complications we should expect in going with this solution, or are
> there any better solutions we should be looking into?
>
> Thanks in advance.
>
> John Fleming
>
Author
28 Feb 2006 4:15 PM
Mark Newmister
You could write a very simple "poll" service that periodically calls (pings)
a web service method.

Show quote
"John" <jflemin***@gmail.com> wrote in message
news:1141138205.068000.269120@j33g2000cwa.googlegroups.com...
> Hello,
>
> We are trying to implement a solution for a project requirement for
> which we need to have multiple services running to support offline
> functionality such as the transmission of emails to subscribed users
> and the publishing of content on specific schedules.  In doing this we
> would like to re-use a lot of the libraries we have already built for
> the web application and, more specifically, re-use all of the
> configuration files which have already been established for the web
> application.
>
> One solution for this is to spawn threads within the Application_Start
> event of the web application which will run continously and handle the
> offline tasks at their set schedules.  This is probably the easiest
> solution to implement, however the only problem is that these threads
> will only be spawned when the first request is made to the web server.
>
> Is there any other event trigger we could work off of that would be
> executed when the web service restarts?  Also, are there any
> complications we should expect in going with this solution, or are
> there any better solutions we should be looking into?
>
> Thanks in advance.
>
> John Fleming
>

AddThis Social Bookmark Button