Tangen...gistry(3pm)

πŸ“¦
version 0.33 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

✨ Tangence::Registry ✨

okay bestie, gather round, because this one is literally the main character of a Tangence server πŸ’…

🌸 NAME 🌸

Tangence::Registry β€” the object manager for a Tangence server 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so. this is a subclass of Tangence::Object, and it's the container for all the exposed objects in a Tangence server. it's giving backstage-pass energy honestly πŸŽ€

the registry is what you use to create exposed objects, and it also manages their lifetime β€” like, it's the one holding the leash, not in a mean way, in a "I got you" way 😌

it keeps a reference to every single object it creates, no cap, so it can dispatch incoming messages from clients to them. it's basically the group chat admin that actually does their job πŸ’€


πŸ’– CONSTRUCTOR πŸ’–

⭐ new

$registry = Tangence::Registry->new;

returns a shiny new instance of a Tangence::Registry object, periodt ✨

one whole server needs exactly one registry object β€” and it gets shared among all the client connections to that server. so like, everybody's in the same gc, okay? one registry, many besties 🌈


πŸ‘‘ METHODS πŸ‘‘

πŸ“ get_by_id

$obj = $registry->get_by_id( $id );

hands you back the object with the given object ID. that's it, that's the vibe πŸ”₯

heads up bestie: this method is exposed to clients, so it's not just for you πŸ‘€

🧚 construct

$obj = $registry->construct( $type, @args );

constructs a brand new exposed object of the given type and returns it. slay πŸŽ€

any extra arguments you throw at it (@args) get passed straight through to the object's own constructor. no gatekeeping, fr fr πŸ’…

🌸 load_tanfile

$registry->load_tanfile( $tanfile );

loads additional Tangence class and struct definitions from the given .tan file. it's giving "let me just import these real quick" ✨


πŸ’œ AUTHOR πŸ’œ

Paul Evans <leonerd@leonerd.org.uk> β€” an actual icon, we love to see it πŸ‘‘


that's the whole page, bestie! this was documented in perl v5.40.0, dated 2024-09-13, and it lives in the User Contributed Perl Documentation section under Tangence::Registry(3pm) πŸ¦‹ ily, go construct something gorgeous πŸ’–

πŸ“¦ where this page comes from