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

Move $nameserver from ExecutorInterface to UdpTransportExecutor #135

merged 1 commit into from Jul 11, 2019


None yet
3 participants
Copy link

commented Jul 11, 2019

This changeset removes the $nameserver argument from the ExecutorInterface and adds it as a constructor attribute to the UdpTransportExecutor. This allows for a significant clean up in our APIs as most of the existing implementations of ExecutorInterface do not care about the nameserver and simply pass it through to some underlying executor. This also allows for future optimizations (such as reusing a single socket for multiple lookups) and helps with future TCP/IP executors (#19) and also multiple DNS servers by implementing fallback strategies as a hierarchy of executors (#6). These APIs are somewhat internal and it's unlikely this will affect many consumers of this package.

// old
$executor = new UdpTransportExecutor($loop);
$promise = $executor->query($nameserver, $query);

// new
$executor = new UdpTransportExecutor($nameserver, $loop);
$promise = $executor->query($query);

Additionally, we can now validate the nameserver address and throw an InvalidArgumentException if it is invalid.

Refs #131
Refs #128

@clue clue added this to the v1.0.0 milestone Jul 11, 2019

@WyriHaximus WyriHaximus requested review from WyriHaximus and jsor Jul 11, 2019


jsor approved these changes Jul 11, 2019

@jsor jsor merged commit 9f5bf59 into reactphp:master Jul 11, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed

@clue clue deleted the clue-labs:nameserver-interface branch Jul 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.