The manakai project

Web::Transport::PlatformResolver

Resolve domain names using platform's resolver

SYNOPSIS

  use Web::Transport::PlatformResolver;
  $resolver = Web::Transport::Resolver->new;
  $resolver->resolve (Web::Host->parse_string ("example.com"))->then (sub {
    warn defined $_[0] && $_[0]->stringify;
  });

DESCRIPTION

The Web::Transport::PlatformResolver module defines a name resolver which resolves names using the system's resolution API.

This module is a resolver (see "RESOLVERS" in Web::Transport).

METHOD

Following methods are available:

$resolver = Web::Transport::PlatformResolver->new

Create a resolver.

$promise = $resolver->resolve ($host, no_cache => $boolean, debug => $mode)

Resolve a domain.

The first argument must be a host (Web::Host) to resolve.

Additionally, named arguments can be specified.

The no_cache named argument is ignored for this resolver (for now, at least). That is, the platform's DNS cache can't be disabled.

The debug argument specifies the debug mode. The default value is 0 (not in the debug mode). See WEBUA_DEBUG section in Web::Transport for available mode values.

The method returns a promise (Promise), which is to be resolved with the result. If the host is a domain and is successfully resolved into an IP address, or the host is an IP address, the promise is resolved with a host (Web::Host) representing that IP address. Otherwise, it is resolved with undef.

SEE ALSO

Web::Transport::CachedResolver.

SPECIFICATION

Web Transport Processing <https://wiki.suikawiki.org/n/Web%20Transport%20Processing>.

AUTHOR

Wakaba <wakaba@suikawiki.org>.

LICENSE

Copyright 2016 Wakaba <wakaba@suikawiki.org>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.