Page 1 of 1

How do I create a Daemon for my php rss reader?

Posted: Fri Jul 04, 2008 12:30 pm
by bobby613
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.

Re: How do I create a Daemon for my php rss reader?

Posted: Fri Jul 04, 2008 1:09 pm
by Eran
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