Пример #1
0
    public function run($request, $response)
    {
        $response->end(123);
        return;
        $ctx = new PromiseContext();
        $ctx->set('aaa', 'bbddddddddddddddddddddddddddddddddddddddddddddddddddddd
		ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssb');
        Promise::create([new ResponseFuture($response)])->start($ctx);
    }
Пример #2
0
 public static function get($api, $params = array())
 {
     $url = $api . '?' . http_build_query($params);
     $proxy = null;
     return Promise::create(new HttpClientFuture($url, null, $proxy, 0.2));
 }