Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supplement the missing parts of runnable code #450

Merged
merged 1 commit into from
Jan 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ Callbacks registered on the Revolt event-loop are automatically run as coroutine
```php
<?php

use function Amp\delay;

require __DIR__ . '/vendor/autoload.php';

use function Amp\delay;

Amp\async(function () {
print '++ Executing callback passed to async()' . PHP_EOL;

Expand Down Expand Up @@ -195,6 +195,8 @@ retrieve multiple HTTP resources concurrently:
```php
<?php

require __DIR__ . '/vendor/autoload.php';

use Amp\Future;
use Amp\Http\Client\HttpClientBuilder;
use Amp\Http\Client\Request;
Expand Down Expand Up @@ -284,6 +286,9 @@ associated `Future` to its caller.
```php
<?php // Example async producer using DeferredFuture

require __DIR__ . '/vendor/autoload.php';

use Amp\Future;
use Revolt\EventLoop;

function asyncMultiply(int $x, int $y): Future
Expand Down
Loading