Skip to content
Permalink
Browse files

Use FileCache from amphp/cache

  • Loading branch information
kelunik committed Nov 29, 2019
1 parent bc8915c commit a8e08d4e2ca922ae61ab8699ea03e01b3c93b9f8
Showing with 6 additions and 160 deletions.
  1. +2 −2 composer.json
  2. +1 −1 examples/github-api-file.php
  3. +1 −1 examples/push.php
  4. +0 −155 src/FileCache.php
  5. +2 −1 src/SingleUserCache.php
@@ -8,8 +8,8 @@
"ext-filter": "*",
"amphp/amp": "^2.4",
"amphp/http": "^1.5",
"amphp/http-client": "4.0.0-rc9",
"amphp/cache": "^1.2",
"amphp/http-client": "dev-http2-split as 4.0.0-rc9",
"amphp/cache": "^1.3",
"psr/log": "^1.1",
"kelunik/string": "^1.0"
},
@@ -1,6 +1,6 @@
<?php

use Amp\Http\Client\Cache\FileCache;
use Amp\Cache\FileCache;
use Amp\Http\Client\Cache\SingleUserCache;
use Amp\Http\Client\HttpClientBuilder;
use Amp\Http\Client\Request;
@@ -47,7 +47,7 @@
$response = yield $client->request(new Request('https://http2-server-push-demo.keksi.io/image.jpg'));
yield $response->getBody()->buffer();

$logger->info('Took {runtime} milliseconds' . ($pushDisabled ? ', run with --disable-push to compare' : ''), [
$logger->info('Took {runtime} milliseconds' . (!$pushDisabled ? ', run with --disable-push to compare' : ''), [
'runtime' => getCurrentTime() - $start,
]);
});

This file was deleted.

@@ -558,7 +558,8 @@ private function storeResponse(
$storedResponses
);
} catch (\Throwable $e) {
$this->logger->warning('Failed to store response in cache due to an exception', [
$this->logger->warning('Failed to store response for {request_uri} in cache due to an exception', [
'request_uri' => $response->getRequest()->getUri()->withUserInfo(''),
'exception' => $e,
]);
} finally {

0 comments on commit a8e08d4

Please sign in to comment.
You can’t perform that action at this time.