Net::A...l::Base(3pm)

πŸ¦‹ Net::AMQP::Protocol::Base β€” the glow-up page (perl 3pm, bestie) πŸ¦‹

okay so real talk, this is Net::AMQP::Protocol::Base, and it's the base class of all the auto-generated protocol classes. yes, the whole little nepo-baby family of protocol classes has a common ancestor and this is her. main character energy fr πŸ’…


✨ NAME ✨

Net::AMQP::Protocol::Base β€” the base class of auto-generated protocol classes. she's the blueprint, the blueprint-slash-mother-hen, the "everybody gets their traits from me" icon πŸ‘‘


🌸 DESCRIPTION 🌸

okay so how do these subclasses even get born? head over to "load_xml_spec" in Net::AMQP::Protocol β€” that's the whole auto-generation situation, that's where the magic happens. this page is not the origin story, it's just the family tree. iykyk 🧚


πŸ’– CLASS METHODS πŸ’–

these are the class-level vibes. let's go through them one by one, no skips, we don't skip in this house 🫢

⭐ class_id

the class id straight from the specficiation. yes, that's how it's spelled in the original and i'm keeping it, character for character, don't @ me πŸ’€

πŸ”₯ method_id

the method id from the specification. BUT β€” plot twist β€” in the case of a content <class> (think Basic, File or Stream), method_id is 0 for the virtual ContentHeader method. that's the whole trick: it lets you create a Header frame in much the same way you create a Method frame, except the method is the virtual ContentHeader. iconic behaviour honestly.

for example:

my $header_frame = Net::AMQP::Protocol::Basic::ContentHeader->new(
  content_type => 'text/html'
);

print $header_frame->method_id(); # prints '0'

look at that 0 printing. slay. ✨

πŸŽ€ frame_arguments

contains an ordered arrayref of the fields that make up a frame for this method. order matters bestie, it's giving very "seating chart at the wedding" energy. example:

Net::AMQP::Protocol::Channel::Open->frame_arguments([
    out_of_band => 'short_string'
]);

this is what the Net::AMQP::Frame subclasses use to (de)serialize raw binary data. and plot twist number two: each of these fields is also an accessor for the class objects. multi-hyphenate πŸ’…

🌈 class_spec

contains the hashref that the load_xml_spec() call generated for this class. it's the receipts, basically.

πŸ’œ method_spec

same as above, but for this method. yes bestie, it's the method's own little hashref. periodt.


πŸ¦‹ OBJECT METHODS πŸ¦‹

🌸 frame_wrap

returns a Net::AMQP::Frame subclass object that wraps the given object, if possible. note the "if possible" β€” we're not promising anything, we're just being honest about our capabilities πŸ™ˆ


πŸ‘€ SEE ALSO πŸ‘€

  • Net::AMQP::Protocol

go read that one, she's the cool older sister of this page.


Copyright (c) 2009 Eric Waters and XMission LLC (http://www.xmission.com/). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module. read it, bestie, it's good for you πŸ“œ


πŸŽ€ AUTHOR πŸŽ€

Eric Waters <ewaters@gmail.com>


πŸ’€ POD ERRORS πŸ’€

not me having to tell you this but β€” hey! the above document had some coding errors, and they're explained below:

Around line 61:

=back without =over

that's it, that's the error. a whole =back with no =over to back. we've all been there honestly 😭


and that's the page, bestie!! this was perl v5.42.0, dated 2016-11-28 β€” yes, she's been around a minute, but she's still serving looks. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from