GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
DBIx::DBHResolver::Strategy::Key(3) User Contributed Perl Documentation DBIx::DBHResolver::Strategy::Key(3)

DBIx::DBHResolver::Strategy::Key - Key based strategy

  use DBIx::DBHResolver;
  use DBIx::DBHResolver::Strategy::Key;

  my $resolver = DBIx::DBHResolver->new;
  $resolver->config(+{
    clusters => +{
      MASTER => +{
        nodes => [ qw(MASTER1 MASTER2 MASTER3) ],
        strategy => 'Key',
      },
    },
    connect_info => +{
      MASTER1 => +{ ... },
      MASTER2 => +{ ... },
      MASTER3 => +{ ... },
    },
  });

  my $strategy = 'DBIx::DBHResolver::Strategy::Key';
  $strategy->connect_info( $resolver, 'MASTER', 3 ); # return MASTER1's connect_info
  $strategy->connect_info( $resolver, 'MASTER', 4 ); # return MASTER2's connect_info
  $strategy->connect_info( $resolver, 'MASTER', 5 ); # return MASTER3's connect_info

This module is key based sharding strategy.

Return connect_info hash ref.

Return resolved node_or_cluster name.

Toru Yamaguchi <zigorou@cpan.org<gt>

This module is licensed under the same terms as Perl itself.

2012-10-21 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.