* Older versions of this talk included this info, so you can find branches using those libs on the GitHub repo I'm demoing from.
If you call a function that yields, you will not execute that function. You'll get back a generator. To execute the function, you (or the event loop) will interact with that generator.
Also, "return" means something different for a generator than for a normal function. The yield keyword changes everything.
$g = gen(1);
$a = $g->current();
2
$b = yield $arg1 + 1;
$c = $g->send($a + 1);
$d = yield $b + 2;
5
3
function gen($arg1)
$e = $g->send($c + 1);
6
return $d + 2;
null
echo $g->getReturn();
8
* Not actually a con. Upgrade already.
siege -c 15 -t 30S -b <url> <cookie header>
** SIEGE 4.0.2 ** Preparing 15 concurrent users for battle. The server is now under siege... Lifting the server siege... Transactions: 9198 hits Availability: 100.00 % Elapsed time: 29.99 secs Data transferred: 551.68 MB Response time: 0.05 secs Transaction rate: 306.70 trans/sec Throughput: 18.40 MB/sec Concurrency: 14.84 Successful transactions: 9198 Failed transactions: 0 Longest transaction: 0.90 Shortest transaction: 0.00
RAM Usage: 61.95MB, CPU usage: 15-35%
** SIEGE 4.0.2 ** Preparing 15 concurrent users for battle. The server is now under siege... Lifting the server siege... Transactions: 9285 hits Availability: 100.00 % Elapsed time: 29.96 secs Data transferred: 552.11 MB Response time: 0.05 secs Transaction rate: 309.91 trans/sec Throughput: 18.43 MB/sec Concurrency: 14.82 Successful transactions: 9285 Failed transactions: 0 Longest transaction: 0.24 Shortest transaction: 0.00
RAM Usage: 11.05MB, CPU usage: 25-35%
I'm @iansltx everywhere