perl-Data-ResourceSet-0.00003-alt1.noarch.rpm


Advertisement

Description

perl-Data-ResourceSet - A Bundle Of Resources

Property Value
Distribution ALT Linux Sisyphus
Repository Autoimports noarch
Package filename perl-Data-ResourceSet-0.00003-alt1.noarch.rpm
Package name perl-Data-ResourceSet
Package version 0.00003
Package release alt1
Package architecture noarch
Package type rpm
Category Development/Perl
Homepage -
License -
Maintainer -
Download size 8.40 KB
Installed size 8.40 KB
Data::ResourceSet is a bag of "stuff", where you can refer to the "stuff"
by name, and the "stuff" will be initialized for you.
For example, say you have multiple DBIx::Class::Schema objects in your
app. You would like to make the reference to each resource as abstract
as possible so you don't hard code anything. Then you can create an
instance of Data::ResourceSet and refer to these schemas by name.
Here are two ways to do it. First is to simply create a resource set from
already instantiated schemas:
my $schema1 = MyCluster1->connect($dsn, $user, $pass);
my $schema2 = MyCluster2->connect($dsn, $user, $pass);
my $resources = Data::ResourceSet->new({
resources => {
schema => {
cluster1 => $schema1,
cluster2 => $schema2,
}
}
});
$resources->resource('schema', 'cluster1')->resultset('FooBar')->search(...)
The other way to do it is by giving a similar hash, but give only the config
my $resources = Data::ResourceSet->new({
resources_config => {
schema => {
cluster1 => {
module      => '+DBIx::Class::Schema',
consturctor => 'connect',
args        => [ $dsn, $user, $pass ],
},
cluster2 => {
module      => '+DBIx::Class::Schema',
consturctor => 'connect',
args        => [ $dsn, $user, $pass ],
}
}
}
});
$resources->resource('schema', 'cluster1')->resultset('FooBar')->search(...)
The difference between the first and the second example above is that
the latter does a lazy initialization. So if you don't want to connect
until you actually use the connection, then the second way is the way to go.
You can also specify this config on a per-package level, say, when you subclass
Data::ResourceSet:
package MyApp::ResourceSet;
use base qw(Data::ResourceSet);
__PACKAGE__->config(
resources => {
schema => {
cluster1 => {
module      => '+DBIx::Class::Schema',
consturctor => 'connect',
args        => [ $dsn, $user, $pass ],
},
cluster2 => {
module      => '+DBIx::Class::Schema',
consturctor => 'connect',
args        => [ $dsn, $user, $pass ],
}
}
}
});
my $resources = MyApp::ResourceSet->new;
$resources->resource('schema', 'cluster1')->resultset('FooBar')->search(...)
You can also use Data::ResourceSet::Adaptor, which can be a proxy between
Data::ResourceSet and your actual resource.
package MyProxy;
use base qw(Data::ResourceSet::Adaptor);
sub ACCEPT_CONTEXT
{
my($self, $c, @args) = @_;
...
return $whatever;
}
my $resource = Data::ResourceSet->new({
resource_config => {
foo => {
bar => {
module => '+MyProxy',
args   => \%whatever
}
}
}
});

Alternatives

Package Version Architecture Repository
perl-Data-ResourceSet - - -

Requires

Name Value
/usr/share/perl5 -
perl(Moose.pm) -
rpmlib(PayloadIsLzma) -

Provides

Name Value
perl(Data/ResourceSet.pm) = 0.0.030
perl(Data/ResourceSet/Adaptor.pm) -
perl-Data-ResourceSet = 0.00003-alt1

Download

Type URL
Mirror ftp.altlinux.org
Binary Package perl-Data-ResourceSet-0.00003-alt1.noarch.rpm
Source Package perl-Data-ResourceSet-0.00003-alt1.src.rpm

Install Howto

  1. Add the following line to /etc/apt/sources.list:
    
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    
  2. Update the package index:
    # sudo apt-get update
  3. Install perl-Data-ResourceSet rpm package:
    # sudo apt-get install perl-Data-ResourceSet

Files

Path
/usr/share/doc/perl-Data-ResourceSet-0.00003/Changes
/usr/share/perl5/Data/ResourceSet.pm
/usr/share/perl5/Data/ResourceSet/Adaptor.pm

See Also

Package Description
perl-Data-Result-1.0003-alt1.noarch.rpm Handling true and false in a better way!
perl-Data-ResultSet-1.001-alt1.noarch.rpm Container for aggregating and examining multiple results
perl-Data-ResultsHelper-1.04-alt1.noarch.rpm perl module Data-ResultsHelper
perl-Data-Riak-2.0-alt1.noarch.rpm An interface to a Riak server
perl-Data-Riak-Fast-0.03-alt1.noarch.rpm more fast interface to a Riak Server
perl-Data-Rlist-1.44-alt1.noarch.rpm perl module Data-Rlist
perl-Data-RoundRobin-0.03-alt1.noarch.rpm Serve data in a round robin manner
perl-Data-RoundRobinShared-0.11-alt1.noarch.rpm Serve data in a round robin manner, keeping the data in a shared memory so that it can be used by m
perl-Data-RuledCluster-0.07-alt1.noarch.rpm clustering data resolver
perl-Data-RuledValidator-0.13-alt1.noarch.rpm data validator with rule
perl-Data-RuledValidator-Plugin-Japanese-0.04-alt1.noarch.rpm Data::RuledValidator plugin for Japanese
perl-Data-RunningTotal-0.03-alt1.noarch.rpm Module that allow you to keep track of running totals within a
perl-Data-Rx-0.200007-alt1.noarch.rpm perl implementation of Rx schema system
perl-Data-Rx-Tools-ShareDirValidator-0.1.3-alt1.noarch.rpm A Simple base class for generating simple validators based on Data::Rx
perl-Data-Rx-Type-MooseTC-0.006-alt1.noarch.rpm experimental / proof of concept Rx types from Moose types
Advertisement
Advertisement