Web Connection
instancing=single with IIS timeout
Gravatar is a globally recognized avatar based on your email address. instancing=single with IIS timeout
  Scott R
  All
  Nov 28, 2023 @ 12:49pm

Hi Rick,

Had a question in regards to instancing=single param (https://webconnection.west-wind.com/docs/_02j0qgvss.htm). I have a long running report that I would like to be able to just send the user an email when it is done with a link to the PDF results and so instancing=single seems like the right way to go. My question is, our IIS is set to auto kill requests after something like 2 minutes. Does the request with instancing=single live outside of the normal queue and IIS won't know about it to kill it and it can run longer or will it still get shut down at the 2 minute mark? If it does get killed by IIS, any other thoughts on how to accomplish something like this?

Thanks, Scott

Gravatar is a globally recognized avatar based on your email address. re: instancing=single with IIS timeout
  Rick Strahl
  Scott R
  Nov 28, 2023 @ 02:57pm

If the request times out Web Connection will try to kill the server instance, so if the request runs longer that's not going to work.

If you have long running operations that can go on indefinitely, you're probably better off offloading the requests to another process. Either just create a separate EXE that you can launch and continue running until completion, or you can use a daemon type program that runs and looks for requests in a database, file on disk etc.

Running long running requests in the confines of a Web request is never a great idea as requests have to complete - you want to return to the user quickly and let them know - hey this may take a while. We'll email you or use some other notification. Alternately you can also check a message table.

There's something sort of built in to Web Connection but it's pretty old and dated -

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: instancing=single with IIS timeout
  Scott R
  Rick Strahl
  Nov 29, 2023 @ 04:07am

Interesting... as far a 'seperate' exe goes, how difficult would it be to call the same exe that runs my regular code? We have a lot of helper functions, etc. to make things easier and I'd rather just have the 1 exe if possible.

So what I'm picturing is:

  • Web connect recieves request.
  • My method decides it's a long running request and basically does a shellEx() on itself with the right params to instantiate/ run as if it was called from IIS but it's not outside of it
  • Original com object doesn't wait for exe called with shellEx() and returns "we'll email you with the results".

Almost like bringing up the exe in file mode instead of com but it lives outside of IIS? Not sure if this would work but I like the idea of 1 exe. Is this possible or is there too much dependent on IIS instantiating things and manually launching my webConnect exe as a standalone exe isn't going to work?

Gravatar is a globally recognized avatar based on your email address. re: instancing=single with IIS timeout
  Rick Strahl
  Scott R
  Nov 29, 2023 @ 01:48pm

You can use the same EXE but then you need to make sure to pass a parameter so it knows which mode to run in to process incoming data differently and not run as a server.

+++ Rick ---

© 1996-2025