473,943 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Background processing in ASP.NET page

Hi,
I'm working on a web application in ASP.NET 3.5 and need some help with
processing stuff in the background.

The user who visits a web page can make reservations. Each reservation
will result in a notification for the user and an involved company.
Sending the notifications can take some seconds but the user shouldn't
need to wait for the page. So the only way to handle this is AFAIK to do
some background processing that is not connected to the page processing
itself.

In the application I store all notifications that need to be sent in the
database so another process can take them from there and send them.
However I'm unsure how to realize this process. Due to the hosted
environment so there is no chance to deploy a Windows service.

The following solutions seem to be possible:
1. Create a QueueUserWorkIt em that handles the process:
ThreadPool.Queu eUserWorkItem(n ew WaitCallback(Se ndNotifications ));

A problem seems to be that under high load the ASP.NET thread pool can
run out of processes.

2. Create a background thread that handles the process:
Thread thread = new Thread(new ThreadStart(Sen dNotifications) );
thread.IsBackgr ound = true;
thread.Start();

3. Create a System.Threadin g.Timer in global.asax that regularly looks
(like every 5 min) for notifications to be sent and sends them.

Has anyone tips which of these solutions seems to be the best in this
case or maybe there is even another one I haven't thought of?

Thanks,
Hilmar
Jun 27 '08 #1
2 2195
Google for Asynchronous Operations in ASP.NET. This could be the starting
point:

http://www.beansoftware.com/asp.net-...n-pattern.aspx
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Hilmar Bunjes" <ne*******@silv eraxe.dewrote in message
news:48******** **************@ newsspool1.arco r-online.net...
Hi,
I'm working on a web application in ASP.NET 3.5 and need some help with
processing stuff in the background.

The user who visits a web page can make reservations. Each reservation
will result in a notification for the user and an involved company.
Sending the notifications can take some seconds but the user shouldn't
need to wait for the page. So the only way to handle this is AFAIK to do
some background processing that is not connected to the page processing
itself.

In the application I store all notifications that need to be sent in the
database so another process can take them from there and send them.
However I'm unsure how to realize this process. Due to the hosted
environment so there is no chance to deploy a Windows service.

The following solutions seem to be possible:
1. Create a QueueUserWorkIt em that handles the process:
ThreadPool.Queu eUserWorkItem(n ew WaitCallback(Se ndNotifications ));

A problem seems to be that under high load the ASP.NET thread pool can run
out of processes.

2. Create a background thread that handles the process:
Thread thread = new Thread(new ThreadStart(Sen dNotifications) );
thread.IsBackgr ound = true;
thread.Start();

3. Create a System.Threadin g.Timer in global.asax that regularly looks
(like every 5 min) for notifications to be sent and sends them.

Has anyone tips which of these solutions seems to be the best in this case
or maybe there is even another one I haven't thought of?

Thanks,
Hilmar

Jun 27 '08 #2
This article http://www.eggheadcafe.com/articles/20040916.asp may provide
some direction on how to use an HttpModule with a Timer to do polling.
--Peter
"Hilmar Bunjes" <ne*******@silv eraxe.dewrote in message
news:48******** **************@ newsspool1.arco r-online.net...
Hi,
I'm working on a web application in ASP.NET 3.5 and need some help with
processing stuff in the background.

The user who visits a web page can make reservations. Each reservation
will result in a notification for the user and an involved company.
Sending the notifications can take some seconds but the user shouldn't
need to wait for the page. So the only way to handle this is AFAIK to do
some background processing that is not connected to the page processing
itself.

In the application I store all notifications that need to be sent in the
database so another process can take them from there and send them.
However I'm unsure how to realize this process. Due to the hosted
environment so there is no chance to deploy a Windows service.

The following solutions seem to be possible:
1. Create a QueueUserWorkIt em that handles the process:
ThreadPool.Queu eUserWorkItem(n ew WaitCallback(Se ndNotifications ));

A problem seems to be that under high load the ASP.NET thread pool can run
out of processes.

2. Create a background thread that handles the process:
Thread thread = new Thread(new ThreadStart(Sen dNotifications) );
thread.IsBackgr ound = true;
thread.Start();

3. Create a System.Threadin g.Timer in global.asax that regularly looks
(like every 5 min) for notifications to be sent and sends them.

Has anyone tips which of these solutions seems to be the best in this case
or maybe there is even another one I haven't thought of?

Thanks,
Hilmar
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4599
by: Bryan Field-Elliot | last post by:
We're designing a web app in which some operations will take a long time to complete (maybe two minutes). Because it's a high-volume application, we don't want browser connections hanging open for these two-minute intervals; that would cause a huge resource drain on the server (open threads, etc.). We've implemented a page which has a <meta refresh> tag in it of 15 seconds, so that the browser can "check back" with the server every so...
1
1950
by: jurot | last post by:
Hi, Can somebody help me,pls? After the button-click on the web-page I execute another thread private void btnExecutePlugin_Click(object sender, System.EventArgs e) { MyThread pt = new MyThread( new MyFinalizeCallback(
2
1887
by: Steve Franks | last post by:
I am familiar with the fact that you have to use runat=server and links staring with "~/" to ensure proper mapping of paths to relative URLs when using master pages. However this does not seem to work in all cases. For instance, assume I have a "/mysite/images" subdirectory with mybackground.gif and mygif.gif in there. Further assume I have a master page called mastertest.aspx located in /mysite/myfolder".
3
3257
by: Viken Karaguesian | last post by:
Hello all, I need somehelp with background tiling. I have a sneaking suspicion that what I want to do is not possible, but I'll ask anyway. :>) First some background: Here's the site in question: www.sayatnova.com (I'm sure many of you have seen this before as I've often asked for help). I've come a long way since I first created the site many moons ago and I'm trying to convert it to a (1) Table-less, (2) Frame-less and (3) Validated...
0
5183
by: Kalpesh | last post by:
Hi All, I am using .net crystal reports to develop the reports. The version of crystal report assemblies is 10.2.3600.0. When i run the reports i got following error. #region Retry Report Data into Dataset if (criteria == "") { dsregional = new DataSet();
8
5389
by: =?Utf-8?B?R3JlZyBMYXJzZW4=?= | last post by:
I'm trying to figure out how to modify a panel (panel1) from a backgroundworker thread. But can't get the panel to show the new controls added by the backgroundwork task. Here is my code. In this code there is a panel panel1, that I populate with a lable in the foreground. Then when I click on "button1" a backgroundworker thread in async mode is started. When the backgoundworker thread completes the thread returns a panel to populate...
2
9826
by: patrice.pare | last post by:
Hello, Here is a summary of my Dev Environment: I use Visual Studio 2005 Team Suite SP1 with Crystal Report XI SP1 on a Windows XP SP2 development workstation. I also use SQL Server 2000 SP4. And here a summary of what is the problem: I have a web application that has a web form into which I read data from a SQL database and load them in a ReportDocument of Crystal
4
1544
by: devphylosoff | last post by:
hi folks I am looking for a tool (script, plugin, code, ...) which can generate background image for webpage look at background on http://vtorrent.info/ page or on the Vista webpage. I want to create this in fly - only give two colours and expect result which will be created by function.
4
1879
by: Marina Levit | last post by:
I am trying to do some processing on a background thread while keeping the UI painting. However, this is a generic server side call routine - and it needs to block until the server side call completes. So the idea is, a server side call begins, it gets spun off on another thread to keep the UI painting - but, the code flow cannot return to the caller until the server side call completes, because the caller expects the data. The only way...
0
10135
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11532
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10662
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9864
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8219
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6308
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4910
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.