Cache:...:Multi(3pm)

πŸ“¦
version 0.27 Β· 2 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– Cache::Memcached::Managed::Multi πŸ’–

okay so bestie, this is a page from the User Contributed Perl Documentation manual, and it's about Cache::Memcached::Managed::Multi β€” a lil perl module that's basically the group-chat admin of your memcached situation πŸŽ€


✨ NAME ✨

Cache::Memcached::Managed::Multi β€” literally just multiple Cache::Memcache::Managed objects hanging out together 🫢


🌸 SYNOPSIS 🌸

use Cache::Memcached::Managed::Multi;

my $multi = Cache::Memcached::Managed::Multi->new( @managed );

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe: this thing gives you the exact same API as Cache::Memcached::Managed, no cap. But when you call a method on it, it applies that method to all of the objects you specified. Every single one. Slay.

The only exceptions β€” the two methods that do not get broadcast like that β€” are new and objects. Those are special, they're the main characters, they get to be themselves πŸ’…


🌈 CONTEXT 🌈

Every method gets called on all of the Cache::Memcached::Managed objects in the same context (list, scalar, or void) that you called it on the Cache::Memcached::Managed::Multi object itself. So the context flows through, iconic behaviour honestly.

And the return value? Its format changes depending on the context too. Let's break it down:

scalar

my $listref = $multi->method;
print "Result: @{$listref}\n";

When you call it in scalar context, you get back a list ref with scalar values, returned in the same order the objects are used β€” and that order is determined by the order they were supplied with new and returned by objects.. ✨

list

my @listref = $multi->method;
print "Result $_: @{$listref[$_]}\n" foreach 0..$#listref;

When you call it in list context, you get back a list of list references, in the same order the objects are used β€” which, again, is determined by the order they were supplied with new and returned by objects. 🧚

void

$multi->method;

When you call it in void context, nothing is returned. Which is honestly not strange at all, the author even put a lil ;-) in there. We love a self-aware king πŸ’€


πŸ‘‘ SPECIFIC CLASS METHODS πŸ‘‘

There is only one specific class method. Just the one. A solo act. 🌟

new

my $multi = Cache::Memcached::Managed::Multi->new( @managed );

Create an object containing multiple Cache::Memcached::Managed objects. Returns the instantiated object. That's it, that's the whole thing πŸ’–


πŸ“ SPECIFIC INSTANCE METHODS πŸ“

objects

my @managed = $multi->objects;

Returns the list of instantiated Cache::Memcached::Managed objects that the object is a proxy for. Basically it tells you who's in the group chat πŸ“±


πŸ’œ AUTHOR πŸ’œ

Elizabeth Mattijsen


(C) 2005 - 2006 BOOKINGS (C) 2007 BOOKING.COM

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

fr fr, that warranty disclaimer is doing the most β€” no promises, bestie, read the license πŸ’…

and that's the whole page, periodt ✨ this was perl v5.40.1, dated 2025-04-24, and it's the Cache:...:Multi(3pm) page β€” go forth and proxy your managed objects, you absolute icon πŸŒΈπŸ¦‹πŸ’–

πŸ“¦ where this page comes from