Jump to content

wait for variable change before calling function?


ultrus

Recommended Posts

Hello,
Is it possible to have php watch a variable for a certain amount of time and call a function once the variable changes?

I'm using php to communicate with another server through COM that can only process one thing at a time. Once it is done processing, a variable changes, meaning that I can access the server again to process something else. If I try to process something while the other server is not idle, I get error messages. Any thoughts on this?  :-\
I bet that would work. One thing that seems to work now for me is using the sleep() function to pause between every communication with the external server. Another idea based on what you said, would be to create a "waiting list" of tasks, and have a cron check the status of the server, and manage tasks in order every second.

Thanks for the inspiration!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.