CPAN::...Ordered(3pm)

πŸ“¦
version 0.010 Β· 7 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– CPAN::Common::Index::Mux::Ordered πŸ’–

okay bestie, so this is CPAN::Common::Index::Mux::Ordered β€” a lil Perl module from the User Contributed Perl Documentation corner of the CPAN universe, and it's giving ✨order✨. It's on version 0.010, so like, it's been around the block a few times and it knows what it's doing. 🫢


🌸 NAME 🌸

CPAN::Common::Index::Mux::Ordered β€” the girl who consults indices in order and returns the first result. no chaos, no randos, just first-come-first-served. periodt. πŸ’…


πŸ¦‹ VERSION πŸ¦‹

version 0.010 ✨


πŸŽ€ SYNOPSIS πŸŽ€

okay so here's the vibe in code form, copy it exactly bestie:

use CPAN::Common::Index::Mux::Ordered;
use Data::Dumper;

$index = CPAN::Common::Index::Mux::Ordered->assemble(
    MetaDB => {},
    Mirror => { mirror => "http://cpan.cpantesters.org" },
);

that's literally it. she's lowkey so chill. 🌸


🌈 DESCRIPTION 🌈

So the whole concept? This module multiplexes multiple CPAN::Common::Index objects, and it returns results in order. Like a group chat where everyone gets their turn to talk, except there's a strict queue and nobody's interrupting. πŸ‘‘

Here's the tea on how it behaves:

  • For exact match queries, the first result is returned. First one wins, no debate, no re-vote. πŸ†
  • For search queries, results from each index object are concatenated. Everybody's getting included, nobody's left on read. πŸ’–

πŸ’œ ATTRIBUTES πŸ’œ

πŸ’« resolvers

An array reference of CPAN::Common::Index::* objects. like, all of them. a whole squad. 🫢


✨ METHODS ✨

🌟 assemble

okay so this one's a class method and it's a shorthand for constructing a multiplexer. the signature is:

$index = CPAN::Common::Index::Mux::Ordered->assemble(
    MetaDB => {},
    Mirror => { mirror => "http://www.cpan.org" },
);

The arguments must be pairs of subclass suffixes and arguments. so like, they come in twos, hand in hand, no solo acts. πŸŽ€

For example, "MetaDB" means to use "CPAN::Common::Index::MetaDB". cute, right? the suffix is basically the nickname and the module gets the full name. 😌

⚠️ heads up bestie: empty arguments must be given as an empty hash reference. so {} β€” not nothing, not undef, an actual empty hash ref. don't skip this step, it's not optional. πŸ’€

πŸ‘‘ AUTHOR πŸ‘‘

David Golden <dagolden@cpan.org> β€” the icon, the legend, the one who wrote the code. πŸ’–


This software is Copyright (c) 2013 by David Golden.

This is free software, licensed under:

The Apache License, Version 2.0, January 2004

free as in free, slay. πŸ¦‹


🌟 SEE ALSO 🌟

ngl there's no SEE ALSO section in this one β€” she's self-sufficient, main character energy, no cross-references needed. πŸ’…


and that's the whole page bestie! πŸ’– This gem lives in the perl v5.36.0 docs, dated 2022-12-09, filed under User Contributed Perl Documentation. go forth and multiplex in order, you got this 🫢✨🌸