Skip to content

Commit

Permalink
Create base
Browse files Browse the repository at this point in the history
  • Loading branch information
jenky committed Jul 3, 2023
1 parent e0e80b9 commit 3535366
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 407 deletions.
14 changes: 3 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,14 @@
}
],
"require": {
"php": "^8.1"
"php": "^8.1",
"jenky/atlas": "^0.4"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.15",
"guzzlehttp/guzzle": "^7.5",
"jenky/atlas": "1.x-dev",
"jenky/atlas-mock-client": "^1.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.0",
"react/async": "^4.1",
"react/http": "^1.9",
"symfony/var-dumper": "^6.3"
"phpunit/phpunit": "^9.0"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -62,10 +58,6 @@
"@test"
]
},
"suggest": {
"react/http": "Required to send concurrent requests using React pool",
"react/async": "Required to send concurrent requests using React pool"
},
"extra": {
"branch-alias": {
"dev-main": "1.x-dev"
Expand Down
127 changes: 0 additions & 127 deletions src/Guzzle/Pool.php

This file was deleted.

31 changes: 0 additions & 31 deletions src/Guzzle/ResolvePromise.php

This file was deleted.

29 changes: 0 additions & 29 deletions src/PoolFactory.php

This file was deleted.

13 changes: 9 additions & 4 deletions src/PoolInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@

namespace Jenky\Atlas\Pool;

use Jenky\Atlas\Response;

/**
* @template TReq
* @template TRes
*/
interface PoolInterface
{
/**
* Set the maximum number of requests to send concurrently.
*/
public function concurrent(int $concurrency): PoolInterface;

/**
* Send concurrent requests.
*
* @param iterable $requests
* @return array<array-key, Response>
* @param iterable<TReq> $requests
* @return array<array-key, TRes>
*/
public function send(iterable $requests): array;
}
30 changes: 0 additions & 30 deletions src/React/Client.php

This file was deleted.

50 changes: 0 additions & 50 deletions src/React/Pool.php

This file was deleted.

25 changes: 0 additions & 25 deletions tests/AkamaiTileRequest.php

This file was deleted.

26 changes: 26 additions & 0 deletions tests/DummyRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace Jenky\Atlas\Pool\Tests;

use Jenky\Atlas\Request;

final class DummyRequest extends Request
{
public function __construct(
private string $uri = 'https://example.com',
private string $method = 'GET'
) {
}

public function method(): string
{
return $this->method;
}

public function endpoint(): string
{
return $this->uri;
}
}
Loading

0 comments on commit 3535366

Please sign in to comment.