Hello,
I came across this little library called TameJS (http://tamejs.org/) and
fell in love with the it's syntax. This had me thinking if it was possible
to add such features to a PHP CLI (or web app):
<?php
await { // wait until all calls within this block is
mysql_query_async($sql, $args, defer($rs)); // call asynchronous query
curl_post_async($url,$data, defer($response)); // make asynchronous http
request
}
$rows = $rs->fetchAll();
// do something here
?>
The "await" keyword marks a section of code that depends on externals
events, like network or disk activity, or a timer. An await block contains
one or more calls to defer.
I think the above syntax makes it easier to write asynchronous apps that can
take advantage of multiple threads or processors
What do you think?
__
Raymond