R
Rob
I've got the following skeleton in my HttpApplication (global.aspx) file:
Public Sub New()
MyBase.New()
ApplicationTimer = New System.Timers.Timer
ApplicationTimer.BeginInit()
ApplicationTimer.Interval = 60 * 1000 ' 60 seconds
ApplicationTimer.Enabled = True
ApplicationTimer.EndInit()
End Sub
Private Sub ApplicationTimer_Elapsed(ByVal sender As Object, ByVal e
As System.Timers.ElapsedEventArgs) Handles ApplicationTimer.Elapsed
' Do something time consuming
End Sub
Is ApplicationTimer_Elapsed run on a separate thread to those processing
HTTP requests? The reason I ask is that the code I'm about to drop into
ApplicationTimer_Elapsed takes several seconds to run. It's sending an email
via SmtpClient.Send(MailMessage) which doesn't seem to return until the
email has been sent.
I don't want this operation to slow up supplying pages to users of the
system requesting web pages.
Thanks, Rob.
Public Sub New()
MyBase.New()
ApplicationTimer = New System.Timers.Timer
ApplicationTimer.BeginInit()
ApplicationTimer.Interval = 60 * 1000 ' 60 seconds
ApplicationTimer.Enabled = True
ApplicationTimer.EndInit()
End Sub
Private Sub ApplicationTimer_Elapsed(ByVal sender As Object, ByVal e
As System.Timers.ElapsedEventArgs) Handles ApplicationTimer.Elapsed
' Do something time consuming
End Sub
Is ApplicationTimer_Elapsed run on a separate thread to those processing
HTTP requests? The reason I ask is that the code I'm about to drop into
ApplicationTimer_Elapsed takes several seconds to run. It's sending an email
via SmtpClient.Send(MailMessage) which doesn't seem to return until the
email has been sent.
I don't want this operation to slow up supplying pages to users of the
system requesting web pages.
Thanks, Rob.