I am using Apache Thrift to communicate between a Java program and a PHP client.
Lets say the Browser-based/User Facing PHP client runs
<?
//Thrift RPC protocol stuff
$result =client->javaMethod();
echo "This is the newest $result";
?>
Let’s say I want the $result variable to be updated every X seconds, is there some AJAX like way of doing this? It’d be nice to use Thrift since its one solution that works across multiple languages…
I’m guessing a "sleep" every X seconds is a bad idea for memory reasons?
Thanks!
Use a timed AJAX call to ping your server, which then executes the RPC call and returns its results. More details in comments above.