Hello
I am writing a script in PHP (and I am not very strong in this :-( ). This script needs to check the status of several items periodically. New items are added constantly and they end constantly.
I was thinking to this with independent timers, but in my research I found:
- PHP does not do multi threading. Therefore I can not run other code during the time the timers run.
- The timer classes I have found are not really timers, they just calculate the elapsed time between start and now.
- i read that having multiple timers run at the same time is not efficient in PHP. But I am not sure how to create 1 timer which is flexible enough to handle upcoming items. I could check through a MySQL table, but time is of the essence in my routine.
- I saw the GTK extension ( but I am not sure if this helps me with what I need. The sample I found looks ok ( However, I am not sure if my Host has that extension installed, but they probably would.
What is usually the preferred method/structure to write something like that?
Any help is greatly appreciated!
Gunnar.
I am writing a script in PHP (and I am not very strong in this :-( ). This script needs to check the status of several items periodically. New items are added constantly and they end constantly.
I was thinking to this with independent timers, but in my research I found:
- PHP does not do multi threading. Therefore I can not run other code during the time the timers run.
- The timer classes I have found are not really timers, they just calculate the elapsed time between start and now.
- i read that having multiple timers run at the same time is not efficient in PHP. But I am not sure how to create 1 timer which is flexible enough to handle upcoming items. I could check through a MySQL table, but time is of the essence in my routine.
- I saw the GTK extension ( but I am not sure if this helps me with what I need. The sample I found looks ok ( However, I am not sure if my Host has that extension installed, but they probably would.
What is usually the preferred method/structure to write something like that?
Any help is greatly appreciated!
Gunnar.