Re: Looking for ideas on scheduling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris W. Parker wrote:
Hello,

I'm looking to make a simple scheduler for myself and I'd like to get
some feedback on how to handle the events and their being executed at
the right time.

The two options I've come up with both involve adding a job(s) to
crontab.

1. Individual jobs are added to the users crontab file. This could
result in LOTS of entries in crontab, but less load on the server.

2. There is one job put in the crontab file that is executed every five
minutes. This job will be executing a PHP file that runs through the
database for the current user and checks to see if any events need to go
off at that time. This will result in only one event in crontab with a
greater potential for load on the server.


I'm leaning towards Option 2*. What do you think? What other options do I have?


while(1) { if ($fiveMinuteHavePast == true) { // check/run jobs } }

but my guess is it will leak... which means you'd have to restart it again...
probably with a cronjob :-)



Chris.

* Hurray for Option magazine!


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux