KiokuDB::Set(3pm)

πŸ“¦
version 0.57 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing

πŸ’– KiokuDB::Set β€” bestie edition πŸ’–

okay so this is the manual page for KiokuDB::Set, a <pink>Set::Object</pink> wrapper for KiokuDB that comes with lazy loading ✨ (iykyk). Yes it's a Perl thing. Yes it's iconic. Sit down, we're doing this together 🫢


✨ VERSION ✨

version 0.57 β€” that's the one, bestie, that's the version we're talking about 🌸


🌈 SYNOPSIS 🌈

okay so here's the whole vibe in code form, no cap:

use KiokuDB::Util qw(set);

my $set = set(); # KiokuDB::Set::Transient

$set->insert($object);

warn $set->size;

my $id = $dir->store( $set );

look at her go 😭 she's so simple and she's doing SO much.


πŸ¦‹ DESCRIPTION πŸ¦‹

so this role β€” a role, like a personality trait but for classes β€” defines the API that these three absolute queens implement:

  • KiokuDB::Set::Transient
  • KiokuDB::Set::Deferred
  • KiokuDB::Set::Loaded

all three are modeled after <purple>Set::Object</purple>, but with implementation details that are specific to KiokuDB. so like, same energy, different lore πŸ’…

πŸŽ€ Transient Sets πŸŽ€

Transient sets are in memory β€” they're sets you (the user) constructed yourself, just chilling, waiting for their subsequent insertion into storage. it's giving "packed and ready to move" 🧳

When you create a new set, this is what you should use. periodt.

KiokuDB::Util provides convenience functions to construct transient sets concisely β€” specifically <cyan>set</cyan> (in KiokuDB::Util) and <cyan>weak_set</cyan> (in KiokuDB::Util). so you don't have to do it the long way, bestie 🌸

πŸ’œ Deferred Sets πŸ’œ

when a set is loaded from the backend, it is deferred by default. what does that mean? it means the objects inside the set are not yet loaded, and they will be fetched only as needed. she's playing hard to get, respectfully πŸ™ˆ

and then β€” when the set members are actually needed β€” the set gets upgraded in place into a KiokuDB::Set::Loaded object. glow up, literally ✨

πŸ‘‘ Loaded Sets πŸ‘‘

this is the result of vivifying the members of a deferred set. and implementation-wise? she's similar to transient sets. same vibe, different chapter πŸ’…


🌟 AUTHOR 🌟

Yuval Kogman <nothingmuch@woobling.org> β€” the legend, the moment, the main character πŸ‘‘


This software is copyright (c) 2014 by Yuval Kogman, Infinity Interactive.

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, honestly 🫢


and that's the whole page, bestie πŸ’– this was KiokuDB::Set, perl v5.34.0, dated 2022-05-23, from the User Contributed Perl Documentation, and you understood every single bit of it. iconic behavior, no notes πŸŒˆβ­πŸŽ€

πŸ“¦ where this page comes from