KiokuDB::Linker(3pm)

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

πŸ’– KiokuDB::Linker πŸ’–

okay bestie, so this is the manual page for KiokuDB::Linker (that's the KiokuDB::Linker(3pm) one, from the User Contributed Perl Documentation corner of the internet) and honestly? it's giving glow-up energy for your object graph. ✨

🌸 VERSION 🌸

version 0.57 β€” she's a specific girl, no cap. πŸ’…


✨ SYNOPSIS ✨

# mostly internal

that's it. that's the whole synopsis. iconic behavior honestly. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so the linker's whole job is reconnecting entry data and recreating the connected object graph in memory. it's the matchmaker, the group-chat admin, the one who remembers who knows who. 🫢

The linkage process starts with an ID (or several IDs) to be loaded, and those get passed to the get_or_load_objects method.

That ID will first be searched for in the live object set (KiokuDB::LiveObjects). If the object is already live, then it will be returned as is β€” no drama, no re-fetching, we simply hand it back. ✨

If the object is not live, then the corresponding entry is fetched from the backend, and expanded into an actual instance. glow up time.

Expansion consults the KiokuDB::TypeMap using KiokuDB::TypeMap::Resolver, to find the correct typemap entry (peep "COLLAPSING STRATEGIES" in KiokuDB::Collapser and KiokuDB::TypeMap), and that is used for the actual expansion. so basically the typemap is the stylist and the resolver is the one who books the appointment. πŸ’…

Most of the grunt work is delegated by the entries back to the linker using the inflate_data method, which handles circular structures, retrying of tied structures, etc. she does the heavy lifting and she does not complain about it. 😀

Inflated objects are registered with KiokuDB::LiveObjects, and get inserted into the current live object scope (KiokuDB::LiveObjects::Scope). The scope's job is to maintain a reference count of at least 1 for any loaded object, until it is destroyed itself. This ensures that weak references are not destroyed prematurely, but allows their use in order to avoid memory leaks. so like... the scope is holding your hand so nothing gets dropped too early, but also not holding on so hard that you leak forever. balanced queen. πŸ‘‘

real talk: the weak-reference thing is the whole point here β€” premature destruction = bad, memory leaks = also bad, and the scope is the vibe check that keeps both from happening.

πŸ‘‘ AUTHOR πŸ‘‘

Yuval Kogman <nothingmuch@woobling.org>

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.


k bye bestie, that's the whole page πŸŽ€ β€” this lil masterpiece came from perl v5.34.0, dated 2022-05-23, and yes she's still serving KiokuDB::Linker(3pm) realness. slay. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from