mirror of
https://github.com/danog/dns.git
synced 2024-11-30 04:29:06 +01:00
Fix example in README (#105)
This commit is contained in:
parent
261fef2ec1
commit
9ebfdf3ba4
@ -21,15 +21,16 @@ require __DIR__ . '/examples/_bootstrap.php';
|
||||
$githubIpv4 = Amp\Dns\resolve("github.com", Dns\Record::A);
|
||||
pretty_print_records("github.com", $githubIpv4);
|
||||
|
||||
$googleIpv4 = Amp\Dns\resolve("google.com", Dns\Record::A);
|
||||
$googleIpv6 = Amp\Dns\resolve("google.com", Dns\Record::AAAA);
|
||||
$firstGoogleResult = Amp\Future\race([
|
||||
Amp\async(fn() => Amp\Dns\resolve("google.com", Dns\Record::A)),
|
||||
Amp\async(fn() => Amp\Dns\resolve("google.com", Dns\Record::AAAA)),
|
||||
]);
|
||||
|
||||
$firstGoogleResult = Amp\Promise\first([$googleIpv4, $googleIpv6]);
|
||||
pretty_print_records("google.com", $firstGoogleResult);
|
||||
|
||||
$combinedGoogleResult = Amp\Dns\resolve("google.com");
|
||||
pretty_print_records("google.com", $combinedGoogleResult);
|
||||
|
||||
$googleMx = yield Amp\Dns\query("google.com", Amp\Dns\Record::MX);
|
||||
$googleMx = Amp\Dns\query("google.com", Amp\Dns\Record::MX);
|
||||
pretty_print_records("google.com", $googleMx);
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user