Cache::Object(3pm)

✨ Cache::Object πŸ’–

okay so bestie, welcome to Cache::Object β€” it's the data stored in a Cache, fr fr. This is one of those Perl manpages from the User Contributed Perl Documentation collection, so pull up a chair 🫢


🌸 NAME 🌸

Cache::Object β€” the data stored in a Cache. yes that's literally the whole name. iconic. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• β€” Object gets used by the classes that implement the Cache interface, and it's basically an object oriented wrapper around the data. a little cozy lil jacket for your bytes, if you will πŸ§₯✨

and here's the part where I have to be honest with you: end users will not normally use Object directly. like, that's not the vibe. instead you can get at it through the get_object method on the Cache::Cache interface. that's the door. use the door πŸšͺπŸ’–


⭐ SYNOPSIS ⭐

here's how it looks when you're actually doing it, bestie:

use Cache::Object;

my $object = new Cache::Object( );

$object->set_key( $key );
$object->set_data( $data );
$object->set_expires_at( $expires_at );
$object->set_created_at( $created_at );

look at her go 😭✨ so clean, so demure.


πŸ’… METHODS πŸ’…

  • new( ) β€” construct a new Cache::Object. that's it, that's the method. baby's first object πŸŽ€

🌈 PROPERTIES 🌈

these all come in (get|set)_whatever flavor, so you can read 'em and write 'em. slay.

  • (get|set)_accessed_at β€” the time at which the object was last accessed. so like, various cache implementations will use the accessed_at property to store info for LRU algorithms β€” you know, the "who gets yeeted first" math πŸ‘‘. but there is no guarantee that all caches will update this field, so don't come for me if it's stale, bestie πŸ™ˆ
  • (get|set)_created_at β€” the time at which the object was created. its birthday πŸŽ‚βœ¨
  • (get|set)_data β€” a scalar containing, or a reference pointing to, the data to be stored. so it can be a plain scalar OR a ref, either one, no cap πŸ’–
  • (get|set)_expires_at β€” the time at which the object should expire from the cache. it's giving "your time is up" β°πŸ’€
  • (get|set)_key β€” the key under which the object was stored. its little name tag 🏷️
  • (get|set)_size β€” the size of the frozen version of this object. the frozen version specifically, okay? not the thawed one πŸ§ŠπŸ“

πŸŽ€ SEE ALSO πŸŽ€

  • Cache::Cache β€” go here, this is the main character πŸ”₯

πŸ‘‘ AUTHOR πŸ‘‘

  • Original author: DeWitt Clinton <dewitt@unto.net>
  • Last author: $Author: dclinton $
  • Copyright (C) 2001-2003 DeWitt Clinton

and that's the whole page, bestie 🫢 written by the perl crew, shipped as part of perl v5.34.0, dated 2022-06-30. mwah πŸ’‹ periodt. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from