hi everyone.
What's the best implementation for creating a php daemon?
Here's my desired use case:
A thread sleeps every 20 minutes, and upon waking up, updates the rss feed in the database.
My ackward solution so far is to have a php class check and updates the rss feed for every site visitor. This is not optimal, since each web visitor will trigger a check-update process. Instead, I'd like to have one seperate thread responsible for the check-update process.
help.
What would be a better implementation.
How do I create a Daemon for my php rss reader?
Moderator: General Moderators
Re: How do I create a Daemon for my php rss reader?
There are two possible ways to handle this -
1. Put a timestamp on the RSS update. Next time only update if 20 minutes have passed since the last update (meaning - check for every user, update only every 20 minutes).
2. Use a cron job. A cron job is an automated unix process that runs periodically (alternatively you have task scheduler on windows). An introduction to cron jobs - http://www.unixgeeks.org/security/newbi ... ron-1.html
1. Put a timestamp on the RSS update. Next time only update if 20 minutes have passed since the last update (meaning - check for every user, update only every 20 minutes).
2. Use a cron job. A cron job is an automated unix process that runs periodically (alternatively you have task scheduler on windows). An introduction to cron jobs - http://www.unixgeeks.org/security/newbi ... ron-1.html