Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

before_update hook #3

Open
marcoarthur opened this issue Aug 14, 2018 · 0 comments
Open

before_update hook #3

marcoarthur opened this issue Aug 14, 2018 · 0 comments

Comments

@marcoarthur
Copy link
Owner

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) }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant