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?  :-\
Link to comment
Share on other sites

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!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.