CHI::D...:Redis(3pm)

πŸ“¦
version 0.10 Β· 2 versions
  • 0.10 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.10 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– CHI::Driver::Redis(3pm) πŸ’–

okay bestie, so this is the User Contributed Perl Documentation page for CHI::Driver::Redis β€” a Redis driver for CHI. and like, it's giving "your cache is on a whole other server and honestly? slay."


✨ NAME ✨

CHI::Driver::Redis β€” Redis driver for CHI πŸ“


🌸 SYNOPSIS 🌸

use CHI;

my $foo = CHI->new(
    driver => 'Redis',
    namespace => 'foo',
    server => '127.0.0.1:6379',
    debug => 0
);

literally that's it. look at you go. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so this is a CHI driver that uses "Redis" to store the data. that's the whole vibe.

and here's the part that matters: care has been taken to not have this module fail in fiery ways if the cache is unavailable πŸ”₯. the author is hoping that if it's failing and the cache isn't required for your work, you can just ignore its warnings. lowkey iconic, highkey considerate.


πŸ’€ TECHNICAL DETAILS πŸ’€

πŸ‘‘ Namespaces.

bestie. Redis does not have namespaces. periodt. so we have to do some hoop-jumping πŸŽ€. no cap.

namespaces are tracked in a set named chinamespaces. this is a list of all the namespaces the driver has seen. yes, it's keeping receipts. πŸ™ˆ

keys in a namespace are stored in a set that shares the name of the namespace. and the actual value is stored as $namespace||key. that's the lil sandwich. that's the whole trick.

🧚 Encoding

this CHI driver uses Redis.pm. and Redis.pm, by default, automatically encodes values to UTF-8 ✨. this driver sets the Redis encoding option to undef to disable automatic encoding. so we're taking the wheel, not the autopilot. 🫢


πŸŽ€ CONSTRUCTOR OPTIONS πŸŽ€

  • "redis" β€” option for the constructed "Redis" object
  • "redis_options" β€” for hash of options to the "Redis" constructor

other options, including "server", "debug", and "password" are passed to the "Redis" constructor. so yeah, they get forwarded. they get the whole tour. πŸ’–


⭐ ATTRIBUTES ⭐

πŸ’œ redis

contains the underlying "Redis" object. that's the real one. the main character. πŸ‘‘


🌈 AUTHOR 🌈

Cory G Watson, "<gphat at cpan.org>" 🫢


🌸 CONTRIBUTORS 🌸

Ian Burrell, "<iburrell@cpan.org>" ✨


Copyright 2009 Cold Hard Code, LLC.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

fr fr, that's the legal bit β€” GPL or Artistic, your choice, both valid, both real. πŸ’…

and that's the whole page bestie!! πŸ’–βœ¨πŸŽ€ this was written for perl v5.36.0 and dated 2022-11-19 β€” the manual page header's from User Contributed Perl Documentation, and yes, CHI::Driver::Redis(3pm) goes at both the top and the bottom, so consider this your cute lil sign-off πŸ¦‹πŸŒΈπŸ«Ά periodt.

πŸ“¦ where this page comes from