Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Await and async in ASP.NET app
Message
 
 
À
15/04/2016 10:00:25
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01634709
Message ID:
01634839
Vues:
24
>>>>>An exe for example. Or a Windows Service.
>>>>>
>>>>>>How do you create a separate process for the email method? (just a hit of key words that I can start Googling, thank you).
>>>>
>>>>Wait what??? Seriously?
>>>>
>>>>a) Proper error handling will shield your from "Email taking down your app".
>>>>b) Anything, just about anything is better than a Windows Service given the nightmare of administration and installation/updating
>>>>c) Standalone Exes are un-managed (as in no monitoring) so that's an even worse idea
>>>>
>>>>So...
>>>>
>>>>Email is hardly a 'dedicate a service to it' operation especially since Email already is an asynchronous operation that doesn't wait for a reply. You submit a message and you're done a second later. Worst case the server waits longer and you're tying up a thread (if you're not using Async) or a completion port. Hardly a problem. Error handling exists to deal with this both for connection failures and timeouts. Crying for a service to handle this is like a using a jackhammer to dig up a flower.
>>>>
>>>>If anything building a small application support Web API/Service that handles long running tasks asynchronously (that hopefully handles more than just sending emails) is the way to go if you really feel you need to isolate things.But please don't use Windows services except as a very last resort.
>>>
>>>Makes sense to me :-}
>>>I suppose the best solution depends on the volume of emails being sent but I'd lean towards a dedicated *generalized* WebApi email handler ?
>>
>>By WebApi email handler do you mean a Web API application installed on the server and then your ASP.NET application calls this app passing it some email parameters (e.g. Recipient email address, body of email message, attachment)?
>
>Basically - yes. Of course if it is on the same site you could call it directly as an async operation as well......
>Maybe let it log operations to a table and email the sender if a send failed ?

Sorry for asking too many questions. When you are saying "call it directly" you mean call a class/method of the ASP.NET application that sends emails?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform