CHI::CacheObject(3pm)

πŸ“¦
version 0.61 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– CHI::CacheObject πŸ’–

okay bestie so this is CHI::CacheObject, a little Perl module (a 3pm page, iykyk) that holds info about cache entries ✨. We're on version 0.61, and she's cute, she's read-only, she's giving ✨receipts about your cache✨.


🌸 SYNOPSIS 🌸

like, here's the vibe:

my $object = $cache->get_object($key);

my $key        = $object->key();
my $value      = $object->value();
my $expires_at = $object->expires_at();
my $created_at = $object->created_at();

if ($object->is_expired()) { ... }

look at her go 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so the CHI method returns this object if the key exists, periodt. and here's the iconic part: the object will be returned even if the entry has expired, as long as it has not been removed. expired but still in the building?? yes ma'am πŸ’…

also, heads up: there is currently no public API for creating one of these objects directly. you don't make her, she just shows up. main character energy fr fr 😭

πŸ‘‘ METHODS πŸ‘‘

all methods are read-only β€” no touching, only looking bestie πŸ™ˆ. and the get_* methods? they're there for backward compatibility with Cache::Cache's Cache::Object. nostalgia core πŸ’œ

  • key β€” the key. that's it, that's the whole thing πŸ’–
  • value β€” the value. iconic, no notes ✨
  • expires_at, get_expires_at β€” epoch time at which the item expires ⏰ bye babe
  • created_at, get_created_at β€” epoch time at which the item was last written to πŸŽ€ the birthday, basically
  • is_expired β€” returns a boolean indicating whether the item has expired 🌸. ngl this may be probabilistically determined if an expires_variance was used β€” so like, she's guessing a lil bit, and that's valid πŸ’…

πŸ”₯ SEE ALSO πŸ”₯

  • CHI β€” the mothership, go look 🫢

πŸ’œ AUTHOR πŸ’œ

Jonathan Swartz <swartz@pobox.com> β€” king behavior πŸ‘‘


This software is copyright (c) 2021 by Jonathan Swartz.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, legally speaking ⭐


and that's the whole page bestie!! πŸŽ€ this was perl v5.32.1, dated 2021-10-15, and you just read CHI::CacheObject(3pm) in full. no skips, no cap, we read every line πŸ’–βœ¨πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from