refactor(provider): split fetch() into startFetch()/resolveFetch()
Splits the provider contract into a non-blocking startFetch() that fires the HTTP request(s) and a resolveFetch() that reads the result, so callers can fire every provider's request before blocking on any of them. Symfony HttpClient is already async under the hood - request() doesn't block until you read the response - so this needs no new dependency.
This commit is contained in:
@@ -6,8 +6,11 @@ namespace App\Service\Provider;
|
||||
|
||||
interface ProviderInterface
|
||||
{
|
||||
/** Fire the HTTP request(s) without blocking; returns an opaque handle for resolveFetch(). */
|
||||
public function startFetch(): mixed;
|
||||
|
||||
/** @return array<string, int> date (Y-m-d) => contribution count */
|
||||
public function fetch(): array;
|
||||
public function resolveFetch(mixed $handle): array;
|
||||
|
||||
public function isConfigured(): bool;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user