ultrus Posted January 18, 2007 Share Posted January 18, 2007 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? :-\ Quote Link to comment Share on other sites More sharing options...
taith Posted January 18, 2007 Share Posted January 18, 2007 not that i know of... however if you set a blank page to refresh every 5-10 seconds, have your phpcode there, that'd do the job... no? Quote Link to comment Share on other sites More sharing options...
ultrus Posted January 18, 2007 Author Share Posted January 18, 2007 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! Quote Link to comment Share on other sites More sharing options...
taith Posted January 18, 2007 Share Posted January 18, 2007 no problem... sorry... i dont know crons... cant help ya out with that... lolonly problem with sleep() is that while() functions can time out... it may just cause ya some problems there... Quote Link to comment Share on other sites More sharing options...
ultrus Posted January 18, 2007 Author Share Posted January 18, 2007 ah! I will keep that in mind. As far as crons go....ehhhh. I'll do the research and/or make a seperate post another time. :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.