OpenSearch

 view release on metacpan or  search on metacpan

lib/OpenSearch/Base.pm  view on Meta::CPAN


    if ( $self->client_cert && $self->client_key ) {
      $ua->cert( $self->client_cert )->key( $self->client_key )->ca_cert( $self->ca_cert );
    }

    push( @{ $self->ua_pool }, $ua );
  }

}

sub ua($self) {
  my $pool = int( rand( $self->pool_count ) );
  return ( $self->ua_pool->[$pool] );
}

sub url( $self, $suffixes = [], $params = {} ) {
  my $random_host = $self->hosts->[ int( rand( scalar( @{ $self->hosts } ) ) ) ];
  my ( $host, $port ) = split( ':', $random_host );
  $port = $port // 9200;

  my $url = Mojo::URL->new->scheme( $self->secure ? 'https' : 'http' )->host($host)->port($port)



( run in 0.804 second using v1.01-cache-2.11-cpan-524268b4103 )