test tab not enter
*test *tab* not enter*
<?php | |
require __DIR__ . "/vendor/autoload.php"; | |
use Amp\Promise; | |
$client = new Http\Adapter\Artax\Client; | |
$request1 = new GuzzleHttp\Psr7\Request("GET", "http://example.com/"); |
<?php | |
require __DIR__ . "/vendor/autoload.php"; | |
use Amp\Promise; | |
$client = new Http\Adapter\Artax\Client; | |
$responses = Promise\wait(Promise\all([ | |
$client->sendAsyncRequest($request1); |
<?php | |
use Amp\Beanstalk\BeanstalkClient; | |
use Amp\Loop; | |
require __DIR__ . "/vendor/autoload.php"; | |
Loop::run(function () { | |
$uri = "udp://127.0.0.1:38925"; |
test tab not enter
*test *tab* not enter*
<?php | |
# Benchmark for the cost of returning a new promise from then() for coroutines. | |
# | |
# - composer install | |
# - php bench.php | |
# - vi vendor/amphp/amp/lib/functions.php # remove 'done' branch --> https://git.io/v7NWW | |
# - php bench.php | |
require __DIR__ . "/vendor/autoload.php"; |
<?php | |
$opts = [ | |
"http" => [ | |
"header" => "User-Agent: kelunik" | |
] | |
]; | |
$context = stream_context_create($opts); |
<?php | |
namespace Amp\Socket; | |
final class TlsContext { | |
const TLSv1_0 = \STREAM_CRYPTO_METHOD_TLSv1_0_SERVER; | |
const TLSv1_1 = \STREAM_CRYPTO_METHOD_TLSv1_1_SERVER; | |
const TLSv1_2 = \STREAM_CRYPTO_METHOD_TLSv1_2_SERVER; | |
private $minVersion = \STREAM_CRYPTO_METHOD_TLSv1_0_SERVER; |
#!/usr/bin/env bash | |
function is_browser { | |
local path=$1 | |
local basename=$(basename $path) | |
if [[ $basename = "chromium-browser" ]]; then | |
return 1 | |
fi |
Kelunik\StreamingResp\IterativeRespParser: 0.526520 @ simpleString | |
Kelunik\StreamingResp\IterativeRespParser: 0.788227 @ bulkString | |
Kelunik\StreamingResp\IterativeRespParser: 1.780007 @ simpleArray | |
Kelunik\StreamingResp\IterativeRespParser: 3.999639 @ incompleteArray | |
Kelunik\StreamingResp\IterativeRespParser: 0.163905 @ clueDos | |
Kelunik\StreamingResp\RecursiveRespParser: 0.779131 @ simpleString | |
Kelunik\StreamingResp\RecursiveRespParser: 1.274417 @ bulkString | |
Kelunik\StreamingResp\RecursiveRespParser: 3.103048 @ simpleArray | |
Kelunik\StreamingResp\RecursiveRespParser: 7.358338 @ incompleteArray | |
Kelunik\StreamingResp\RecursiveRespParser: 0.329863 @ clueDos |
<?php | |
use Amp\Parser\Parser; | |
class RespParser extends Parser { | |
private $onResponse; | |
public function __construct(callable $onResponse) { | |
$this->onResponse = $onResponse; | |
parent::__construct($this->parse()); |