4 require __DIR__
."/../vendor/autoload.php";
7 Handler\StreamHandler
, Logger
10 $log = new Logger("seekat");
11 $log->pushHandler(new StreamHandler(STDERR
, Logger
::INFO
));
14 $redis->connect("localhost");
15 $redis->setOption(Redis
::OPT_SERIALIZER
, Redis
::SERIALIZER_PHP
);
16 $cache = new class($redis) implements \seekat\API\Call\Cache\Service
{
18 function __construct(Redis
$redis) {
19 $this->redis
= $redis;
22 return $this->redis
->flushDB();
24 function fetch(string $key, \http\Client\Response
&$response = null): bool {
25 list($exists, $response) = $this->redis
32 function store(string $key, \http\Client\Response
$response): bool {
33 return $this->redis
->set($key, $response);
37 $api = new seekat\
API(seekat\API\Future\react
(), [
38 "Authorization" => "token ".getenv("GITHUB_TOKEN")
39 ], null, null, $log, $cache);
41 $api(function($api) use($cache) {
42 yield
$api->users
->m6w6();
43 yield
$api->users
->m6w6();