Cataly...urried(3pm)

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

πŸ’– Catalyst::Plugin::Cache::Curried πŸ’–

okay bestie, welcome to Catalyst::Plugin::Cache::Curried, a little slice of the User Contributed Perl Documentation (section 3pm) that's here to make your caching life SO much cuter. πŸŽ€

✨ NAME ✨

Catalyst::Plugin::Cache::Curried β€” it's giving curried versions of cache_set, cache_get and cache_remove, except they look way more like a backend. periodt. πŸ’…


🌸 SYNOPSIS 🌸

my $curried = $c->cache( %meta );

$curried->get( $key, $value ); # no need to specify %meta

like… no need to specify %meta every single time?? iconic behavior fr fr. πŸ¦‹


πŸ¦‹ DESCRIPTION πŸ¦‹

lowkey the whole vibe is explained in "META DATA" in Catalyst::Plugin::Cache β€” go peek at that for the details, bestie. πŸ‘‘


πŸ’… METHODS πŸ’…

  • new %meta β€” makes you a brand new curried cache, and it captures %meta while it's at it. so you never have to repeat yourself again. slay. ✨
  • backend %additional_meta β€” this one calls choose_cache_backend on the $c object, passing along the meta it already captured plus the additional meta you hand it. two metas, one backend, no cap. πŸ”₯
  • set $key, $value, %additional_meta
  • get $key, %additional_meta
  • remove $key, %additional_meta
  • compute $key, $code, %additional_meta

these four delegate to the c object's cache_set, cache_get, cache_remove or cache_compute β€” and the order is the moment: your arguments first, then the captured meta from meta, and then the additional meta. 🫢

  • meta β€” hands you back the array ref that captured %meta back when you called new. it's literally the receipts. 🧾
  • c β€” the captured $c object that everything delegates to. main character energy, honestly. πŸ‘‘

bestie reminder: every single method here is just the curried version of a plain cache_* call, so the %meta you captured at new time is always riding along. that's the whole point. πŸ’–

and that's the page!! written by the lovely User Contributed Perl Documentation crew, shipped with perl v5.34.0, dated 2022-06-09 β€” mwah, tysm for reading, go cache something cute πŸŒˆπŸ’œ

πŸ“¦ where this page comes from