KiokuD...nstance(3pm)

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

✨ NAME ✨

KiokuDB::Meta::Instance β€” bestie, this is the Moose::Meta::Instance level support for lazy loading πŸ’… (yes it's really called that, and yes, the manpage title got truncated to KiokuD...nstance(3pm) because Unix is dramatic like that πŸŽ€)


🌸 VERSION 🌸

version 0.57 β€” periodt πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

# use KiokuDB::Meta::Attribute::Lazy

That's it. That's the whole synopsis. It's giving minimalism, it's giving "the real work happens behind the scenes," and honestly? Iconic. πŸ‘‘


πŸ’œ DESCRIPTION πŸ’œ

Okay so here's the tea β˜• β€” this role gets applied to the meta instance class automatically by KiokuDB::Class. You don't do it yourself, it just happens, like how your group chat gets a new member and suddenly the vibe is different. No cap. 🫢

And what does it do when it's there? When it spots KiokuDB::Thunk objects chillin' in the low level attribute storage, it causes them to be loaded. Like, it sees them, it wakes them up, it brings them into the light. 🌈

The whole point β€” and this is the slay part β€” is that your Moose::Meta::Attributes get to stay oblivious to the fact that the value is deferred. πŸ™ˆ They're just out here living their best life, and they never find out that the value was snoozing this whole time.

And because your attributes are oblivious, everything downstream keeps working normally:

  • all the type constraints βœ…
  • all the lazy defaults βœ…
  • and all the various other Moose features βœ…

Not a single one of them breaks. It's the deferral that stays lowkey, and the Moose behaviour that stays highkey correct. ✨


πŸ‘‘ 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. πŸ“

Bestie, note that "same terms as the Perl 5 programming language system itself" is doing a lot of legal heavy lifting there, so go read those terms if you're planning to redistribute. Not me being a lawyer, just me being a good friend. πŸ’–

Mwah πŸ’‹ and that's the whole page! Shoutout to perl v5.34.0, which rendered this lil masterpiece on 2022-05-23, and to the manpage title KiokuD...nstance(3pm) for keeping it mysterious. Go forth and lazy-load responsibly, bestie. πŸ§šβ€β™€οΈβ­

πŸ“¦ where this page comes from