Skip to content

before_update hook #3

@marcoarthur

Description

@marcoarthur

Before update code to be used when expiration happens:

has temperature => (
  traits => ['Cache'],
  is => 'rw',
  isa => 'Int',
  builder => _get_temperature,
  required => 1,
  expiration_time => 10,
  before_update => sub { my ($self, $expired) = @_; $self->save_or_discard($expired) }
);

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions