amphp / dns

Async DNS resolution for PHP based on Amp.
https://amphp.org/dns
MIT License
157 stars 32 forks source link

Remove amphp/file and amphp/uri dependencies #80

Closed trowski closed 5 years ago

trowski commented 5 years ago

Replaces async loading of hosts and resolver files with blocking reads by default. An async file loader is also provided.

HostLoader is now an interface, therefore is a BC break, though likely would not affect most users.

The third commit uses the async loader by default if amphp/file is installed. Thoughts?

Closes #78.

trowski commented 5 years ago

Forgot about also removing amphp/uri by dropping the two functions used into this library. By including these functions in this library, we can use them in amphp/socket and deprecate amphp/uri.

PeeHaa commented 5 years ago

I will need to test these, but I have a feeling this is going to make it much more stable \o/

I am not entirely sure yet about the name here though. Maybe BlockingHostLoader to make it clear from the outside what it is / does? I will play with it a bit and see if it's more stable (at least on windows).

trowski commented 5 years ago

@PeeHaa I think you're right that 'blocking' is more clear, so I renamed SyncConfigFileReader to BlockingConfigFileReader. DefaultHostLoader is dependent on the ConfigFileReader instance passed, so it's not necessarily blocking.