Cache-Ref

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

      },
      "runtime" : {
         "requires" : {
            "Carp" : 0,
            "Hash::Util::FieldHash::Compat" : 0,
            "List::Util" : 0,
            "Moose" : 0,
            "Moose::Role" : 0,
            "MooseX::Role::Parameterized" : 0,
            "Scalar::Util" : 0,
            "namespace::autoclean" : 0
         }
      },
      "test" : {
         "requires" : {
            "Test::Moose" : 0,
            "Test::More" : 0,
            "ok" : 0
         }
      }
   },

META.yml  view on Meta::CPAN

  version: 1.4
name: Cache-Ref
requires:
  Carp: 0
  Hash::Util::FieldHash::Compat: 0
  List::Util: 0
  Moose: 0
  Moose::Role: 0
  MooseX::Role::Parameterized: 0
  Scalar::Util: 0
  namespace::autoclean: 0
resources:
  bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Cache-Ref
  homepage: http://search.cpan.org/dist/Cache-Ref
  repository: git://github.com/nothingmuch/cache-ref.git
version: 0.04
x_Dist_Zilla:
  plugins:
    -
      class: Dist::Zilla::Plugin::GatherDir
      name: '@Filter/@Basic/GatherDir'

Makefile.PL  view on Meta::CPAN

  'LICENSE' => 'perl',
  'NAME' => 'Cache::Ref',
  'PREREQ_PM' => {
    'Carp' => '0',
    'Hash::Util::FieldHash::Compat' => '0',
    'List::Util' => '0',
    'Moose' => '0',
    'Moose::Role' => '0',
    'MooseX::Role::Parameterized' => '0',
    'Scalar::Util' => '0',
    'namespace::autoclean' => '0'
  },
  'VERSION' => '0.04',
  'test' => {
    'TESTS' => 't/*.t'
  }
);


unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
  my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};

lib/Cache/Ref/CAR.pm  view on Meta::CPAN

BEGIN {
  $Cache::Ref::CAR::VERSION = '0.04';
}
# ABSTRACT: CLOCK with Adaptive Replacement

use Moose;

use List::Util qw(max min);
use Cache::Ref::CAR::Base ();

use namespace::autoclean;

extends qw(Cache::Ref);

with qw(Cache::Ref::CAR::Base);

sub _mru_history_too_big {
    my $self = shift;

    $self->_mru_history_size
        and

lib/Cache/Ref/CAR/Base.pm  view on Meta::CPAN

#
# the circular buffers should finish being implemented using the doubly linked
# list role
#
# CART needs a bunch of simplifications in the code
#
# the various linked list APIs should probably be consolidated to respect the
# MFU bit, with _move_to_history, _restore_from_history etc checking that
# instead of having two methods per each

use namespace::autoclean;

sub REF_BIT ()         { 0x01 }
sub MFU_BIT ()         { 0x02 }
sub LONG_TERM_BIT ()   { 0x04 }

requires qw(
    _mru_history_too_big
    _mfu_history_too_big

    _restore_from_mfu_history

lib/Cache/Ref/CART.pm  view on Meta::CPAN

BEGIN {
  $Cache::Ref::CART::VERSION = '0.04';
}
# ABSTRACT: CAR with temporal filtering

use Moose;

use List::Util qw(max min);
use Cache::Ref::CAR::Base ();

use namespace::autoclean;

extends qw(Cache::Ref);

with qw(Cache::Ref::CAR::Base);

has _long_term_utility_size => ( # q
    is => "ro",
    writer => "_set_long_term_utility_size",
    default => 0,
);

lib/Cache/Ref/CLOCK.pm  view on Meta::CPAN

BEGIN {
  $Cache::Ref::CLOCK::AUTHORITY = 'cpan:NUFFIN';
}
BEGIN {
  $Cache::Ref::CLOCK::VERSION = '0.04';
}
# ABSTRACT: CLOCK cache replacement algorithm

use Moose;

use namespace::autoclean;

extends qw(Cache::Ref);

with qw(Cache::Ref::CLOCK::Base);

has k => (
    isa => "Int",
    is  => "ro",
    default => 1,
);

lib/Cache/Ref/CLOCK/Base.pm  view on Meta::CPAN

package Cache::Ref::CLOCK::Base;
BEGIN {
  $Cache::Ref::CLOCK::Base::AUTHORITY = 'cpan:NUFFIN';
}
BEGIN {
  $Cache::Ref::CLOCK::Base::VERSION = '0.04';
}
use Moose::Role;

use namespace::autoclean;

with qw(
    Cache::Ref::Role::API
    Cache::Ref::Role::Index
);

requires qw(_hit);

has size => (
    isa => "Int",

lib/Cache/Ref/FIFO.pm  view on Meta::CPAN

package Cache::Ref::FIFO;
BEGIN {
  $Cache::Ref::FIFO::AUTHORITY = 'cpan:NUFFIN';
}
BEGIN {
  $Cache::Ref::FIFO::VERSION = '0.04';
}
use Moose;

use namespace::autoclean;

extends qw(Cache::Ref);

with qw(
    Cache::Ref::Role::API
    Cache::Ref::Role::Index
);

has size => (
    isa => "Int",

lib/Cache/Ref/GCLOCK.pm  view on Meta::CPAN

BEGIN {
  $Cache::Ref::GCLOCK::AUTHORITY = 'cpan:NUFFIN';
}
BEGIN {
  $Cache::Ref::GCLOCK::VERSION = '0.04';
}
# ABSTRACT: GCLOCK cache replacement algorithm

use Moose;

use namespace::autoclean;

extends qw(Cache::Ref);

with qw(Cache::Ref::CLOCK::Base);

sub _hit {
    my ( $self, $e ) = @_;

    $_->[0]++ for @$e;
}

lib/Cache/Ref/LIFO.pm  view on Meta::CPAN

BEGIN {
  $Cache::Ref::LIFO::AUTHORITY = 'cpan:NUFFIN';
}
BEGIN {
  $Cache::Ref::LIFO::VERSION = '0.04';
}
# ABSTRACT: Saves entries until full, discarding subsequent sets.

use Moose;

use namespace::autoclean;

extends qw(Cache::Ref);

with (
    'Cache::Ref::Role::API',
    'Cache::Ref::Role::Index' => {
        -alias => {
            _index_get => "get",
        },
    },

lib/Cache/Ref/LRU.pm  view on Meta::CPAN

}
BEGIN {
  $Cache::Ref::LRU::VERSION = '0.04';
}
# ABSTRACT: Least recently used expiry policy

use Moose;

use Cache::Ref::Util::LRU::List;

use namespace::autoclean;

extends qw(Cache::Ref);

with qw(
    Cache::Ref::Role::API
    Cache::Ref::Role::Index
);

has size => (
    isa => "Int",

lib/Cache/Ref/Null.pm  view on Meta::CPAN

BEGIN {
  $Cache::Ref::Null::AUTHORITY = 'cpan:NUFFIN';
}
BEGIN {
  $Cache::Ref::Null::VERSION = '0.04';
}
# ABSTRACT: Caches nothing

use Moose;

use namespace::autoclean;

extends qw(Cache::Ref);

with qw(Cache::Ref::Role::API);

sub get { return }
sub hit { return }
sub set { return }
sub remove { return }
sub clear { return }

lib/Cache/Ref/Random.pm  view on Meta::CPAN

package Cache::Ref::Random;
BEGIN {
  $Cache::Ref::Random::AUTHORITY = 'cpan:NUFFIN';
}
BEGIN {
  $Cache::Ref::Random::VERSION = '0.04';
}
use Moose;

use namespace::autoclean;

extends qw(Cache::Ref);

with qw(
    Cache::Ref::Role::API
    Cache::Ref::Role::Index
);

has size => (
    isa => "Int",

lib/Cache/Ref/Role/API.pm  view on Meta::CPAN

BEGIN {
  $Cache::Ref::Role::API::AUTHORITY = 'cpan:NUFFIN';
}
BEGIN {
  $Cache::Ref::Role::API::VERSION = '0.04';
}
use Moose::Role;

use Carp qw(croak);

use namespace::autoclean;

requires qw(
    get
    set
    remove
    clear
    hit
    expire
);

lib/Cache/Ref/Role/Index.pm  view on Meta::CPAN

package Cache::Ref::Role::Index;
BEGIN {
  $Cache::Ref::Role::Index::AUTHORITY = 'cpan:NUFFIN';
}
BEGIN {
  $Cache::Ref::Role::Index::VERSION = '0.04';
}
use Moose::Role;

use namespace::autoclean;

# the index handles the by key lookup for all expiry methods
# the actual entries are set up by the manager though
# an entry in the index does not mean the key is live, it only means that it is
# known
has _index => (
    isa => "HashRef",
    default => sub { return {} },
    is => "ro",
);

lib/Cache/Ref/Util/LRU/API.pm  view on Meta::CPAN

package Cache::Ref::Util::LRU::API;
BEGIN {
  $Cache::Ref::Util::LRU::API::AUTHORITY = 'cpan:NUFFIN';
}
BEGIN {
  $Cache::Ref::Util::LRU::API::VERSION = '0.04';
}
use Moose::Role;

use namespace::autoclean;

requires qw(
    insert
    hit
    remove

    clear

    mru
    lru

lib/Cache/Ref/Util/LRU/Array.pm  view on Meta::CPAN

  $Cache::Ref::Util::LRU::Array::AUTHORITY = 'cpan:NUFFIN';
}
BEGIN {
  $Cache::Ref::Util::LRU::Array::VERSION = '0.04';
}
use Moose;

use Scalar::Util qw(refaddr);
use Hash::Util::FieldHash::Compat qw(id);

use namespace::autoclean;

has _list => (
    traits => [qw(Array)],
    isa => "ArrayRef",
    default => sub { [] },
    is => "ro",
    handles => {
        #size       => "length",
        mru        => [ get => 0 ],
        lru        => [ get => -1 ],

lib/Cache/Ref/Util/LRU/List.pm  view on Meta::CPAN

package Cache::Ref::Util::LRU::List;
BEGIN {
  $Cache::Ref::Util::LRU::List::AUTHORITY = 'cpan:NUFFIN';
}
BEGIN {
  $Cache::Ref::Util::LRU::List::VERSION = '0.04';
}
use Moose;

use namespace::autoclean;

with (
    'Cache::Ref::Util::LRU::API',
    'Cache::Ref::Role::WithDoublyLinkedList' => {
        name => "",
        value_offset => 0,
        next_offset => 1,
        prev_offset => 2,

        head_method  => "mru",

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.082 second using v1.00-cache-2.02-grep-82fe00e-cpan-c98054f2a92 )