bit of noob question regarding .Net and C#.
I have a function that registers a new user. Via rpc some values are sent from the ui to a register function and a user record is put in the database.
Then a value representing success is sent back to the ui.
Now, on the same function call I want to send some emails etc to the new user. This can take quite a while to complete, so I don’t want the ui to be waiting around for its return value.
How would I return the value prior to the email jobs being complete? Is it a case of dispatching events within the register function, to set off the email function(s) and then sending the return value back to the ui?
Pardon my ignorance, I’m just starting with .net
In your function, add a work item to the threadpool that sends emails. Then return the value