I am working on both server side (beginning) and mobile side. There is an interesting thing but I am lack of experience to make a decision. I am appreciated any helps from you guys.
I have to send an email after 50 minutes
1/ If we have a timer for each email on server, then 1000 users, 1000 timers?
2/ If we handle it on mobile, there is a case that everything of the app is killed by OS before sending email.
The question is: server and mobile, which one is better?
Please let me know your solution. Thank you in advanced!
Use aqueue
system on the server. Create a queue for sending emails.
When you want to send an email just push it in the queue, with time or DateTime in your case. Then run aCron Job
to check, process and send the email.
Also, make sure to implement the retry functionality, so that even email sending was failed the Cron will take the job again and try to send for anumber of times
.
These Links will Help:
If you are confused about how to setup the Timings of Cron, checkout this website:
This is better to implement the timer on your server. The negative possibility that would happen and block the function if you implement the timer on the device is when the device is on power-off mode or the device couldn't connect to the server to trigger for sending the email.
The serverinstance
is should long-lived, this is should never go down, and this could be more reliable for your case, as @Harish ST answer, you can take a profit from cron job / cron task.
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.
PHP (from the English Hypertext Preprocessor - hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites.
The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.
https://www.php.net/
Welcome to the Q&A site for web developers. Here you can ask a question about the problem you are facing and get answers from other experts. We have created a user-friendly interface so that you can quickly and free of charge ask a question about a web programming problem. We also invite other experts to join our community and help other members who ask questions. In addition, you can use our search for questions with a solution.
Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.
Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.