Skip to content

Commit

Permalink
Update async task lifecycle controls and error handling in code
Browse files Browse the repository at this point in the history
  • Loading branch information
Thavarshan committed Oct 3, 2024
1 parent 5e5561e commit bf09f6a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,19 @@ $client = new Client([
]);

// Use the custom client with FetchPHP
$response = ClientHandler::handle('GET', '/endpoint', ['client' => $client]);
$response = fetch('/endpoint', ['client' => $client]);

$data = $response->json();

// Use the custom client with FetchPHP for async requests
$response async(fetch('/endpoint', ['client' => $client]));

$data = $response->json();

// Use the custom client with directly on the client handler
$handler = new ClientHandler($client, $options); // where $options are all possible Guzzle options

$response = $handler->get('/endpoint');

$data = $response->json();
```
Expand Down

0 comments on commit bf09f6a

Please sign in to comment.