I am new to programming.I am using golang in the backend and reactjs in the front end of the leave Web application that i m creating.
When an employee apply leave i must send email to the in-charge of the employee and employee who applied the leave.Since the email send is taking long time i want to run the email function in go routine.If that the case the http response is send before the status of the email function is returned(Example: Email Send Success or Email Send Failure).
So i would like to push the result of the email function in notification to the front end from the server.But i don't know how to do it as the server already given the http response to the front end before the completion of the email function.
Is there any other better idea to implement this please let me know.Appreciate any help.Thanks